I am working on a module where you can create users and link them to specific restaurants. When a user is created, the manager of the restaurant and if set, the contact person of that restaurant gets a mail notification with the message that a new user is created and linked to that restaurant.
Now I'm trying to achieve the next case: when the notification is sent, al the added admin email addresses need to be notified with the same email, just like a bcc. But when I'm using the bcc and the notification is sent to like 2 users, the bcc will also send twice.
Since I can't add just email addresses to the Notification::send()
method, I can't achieve this in one line of code. My current Notification:
Notification::send($users, new UserCreated($params));
How I think it should be done:
$emailAddresses = ['[email protected]', '[email protected]']
Notification::send([$users, $emailAddresses], new UserCreated($params);
How can I achieve this in the right way?
)
at the end ofNotification::send(
by the way – Tarasovych$users
variable, can't you? – Tarasovych