add custom locale per recipient
This commit is contained in:
parent
3178fc309c
commit
9df8151682
|
@ -138,6 +138,10 @@ class PushTemplate implements \JsonSerializable
|
|||
$data['unsubscribe_url'] = $recipient['unsubscribe_url'];
|
||||
}
|
||||
|
||||
if (! empty($recipient['locale'])) {
|
||||
$data['locale'] = $recipient['locale'];
|
||||
}
|
||||
|
||||
$this->recipients[] = $data;
|
||||
}
|
||||
}
|
||||
|
@ -152,7 +156,7 @@ class PushTemplate implements \JsonSerializable
|
|||
* @param string|null $unsubscribe_url
|
||||
* @return $this
|
||||
*/
|
||||
public function addRecipient(string $email, string $name = null, array $parameters = [], string $unsubscribe_url = null): PushTemplate
|
||||
public function addRecipient(string $email, string $name = null, array $parameters = [], string $unsubscribe_url = null, string $locale = null): PushTemplate
|
||||
{
|
||||
$data = [
|
||||
'email' => $email
|
||||
|
@ -170,6 +174,10 @@ class PushTemplate implements \JsonSerializable
|
|||
$data['unsubscribe_url'] = $unsubscribe_url;
|
||||
}
|
||||
|
||||
if (! is_null($locale)) {
|
||||
$data['locale'] = $locale;
|
||||
}
|
||||
|
||||
$this->recipients[] = $data;
|
||||
|
||||
return $this;
|
||||
|
|
Loading…
Reference in New Issue