-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Send different email content to different users friends list #219
Comments
It looks like you are on the right track. You just need one transmission and content with let transmission = {
recipients: [
{
address: {
email: 'mr_slate@bedrock.com',
name: 'Mr. Slate'
},
substitution_data: {
sender: {
name: 'Fred Flintstone'
}
}
}, {
address: {
email: 'bambam@bedrock.com',
name: 'Bambam Rubble'
},
substitution_data: {
sender: {
name: 'Wilma Flintstone'
}
}
}
],
content: {
from: {
name: '{{ sender.name }}',
email: 'hello@flintstone.com'
},
subject: 'Howdy!',
reply_to: 'My Information <hello@flintstone.com>',
text: 'Hi {{ address.name }} Some other information\n {{ sender.name }}',
html: '<p>Hi {{ address.name }} Some other information<p>{{ sender.name }}</p>'
}
} I just tried this with real email addresses and it worked. Please let me know if you have any additional questions. |
that looks great, but is there a way where the content.subject/text/html can be different for each User? At the moment, each User is sending the same email content to their recipients, Fred Flintstone may not want to send the same content as Wilma Flintstone |
You would have to figure out a way to pass the content into the template from substitution_data. It might be worth it to just send multiple transmission posts. |
Thats cool, I'll have a play around and see what i can create, otherwise it will have to be multiple transmissions post. Thanks for the help @aydrian |
No worries. There's no reason to squish everything into one post if it doesn't make sense. :) |
Hi, Im trying to figure out how to send multiple transmissions in one request (an array of objects), is this possible?
Basically, I have a list of users, who each have a list of friends (recipients). For each users, I need the ability to send out an email to their friends, each user can have different email content from other users. I also need a way to pass the relevant users names to each transmission object as it will be included in the email content
So as a rough (incomplete) example, could i do the following:
Thanks in advance
The text was updated successfully, but these errors were encountered: