multiple email sending

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
ppp
User
Posts: 41

multiple email sending

Post by ppp »

Hello,
I have to send more than one email on a single add event, each one with contents personalised by different addresses.
I know how to send to multiple addresses, but in the email_sending event I can't set different contents for different addresses,
Is there a way to do this?
Thank you!


mobhar
User
Posts: 11745

Post by mobhar »

You may send different content for different email by adding the conditional check inside that Email_Sending server event.


ppp
User
Posts: 41

Post by ppp »

thank you, the conditional check for the content it's good if the mail is one, but I don't know how to send many mails, each one with its own address and content


mobhar
User
Posts: 11745

Post by mobhar »

You have already answered it. Just do the similar thing when you check for one email; just check based on your own criteria for the different email and different content.


ppp
User
Posts: 41

Post by ppp »

what do you mean for conditional check?
I have to do something similar as below, two e-mails to different Bcc for the same add action, with different content; I think this is wrong

$Email->Bcc = "address1@xyz.com, address2@xyz.com";

if ($Email->Bcc == "address1@xyz.com") {
$Email->Content = "a";
}

if ($Email->Bcc == "address2@xyz.com") {
$Email->Content = "b";
}


mobhar
User
Posts: 11745

Post by mobhar »

Try:

$Email->Bcc = "address1@xyz.com, address2@xyz.com";

if (strpos($Email->Bcc, "address1@xyz.com") !== false) {
$Email->Content = "a";
}

if (strpos($Email->Bcc, "address2@xyz.com") !== false) {
$Email->Content = "b";
}


ppp
User
Posts: 41

Post by ppp »

Thank you ,but in that way, both addresses receive content "b"


mobhar
User
Posts: 11745

Post by mobhar »

Because the content is sent to both emails, so that the last content will always be received, too.

The closest approach for your case is to send different content for each email recipient.


Post Reply