-
Notifications
You must be signed in to change notification settings - Fork 625
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
Sending one email to multiple email addresses without them all appearing in the To line #629
Comments
Hello @gavrichards, I think this is the use case needed. Please let me know. With Best Regards, Elmer |
Hi Elmer |
@gavrichards , I'm not sure if this will work for you, but what I've been doing is adding personalizations to the mail object.
This way I get the contacts to only see their email address on the message. |
Hello @gavrichards, Please see @alemadlei-tech's response. Thanks! @alemadlei-tech, Thanks for taking the time to share your solution! |
Thanks both, I'll give this a try and report back. |
@alemadlei-tech @thinkingserious Hi
However I'm receiving this error:
Can you see where I might be going wrong? |
@gavrichards, depending on how you instantiated your mail object, it might contain an empty personalization object. So, there's a chance your email has 2 personalization objects or more, with the first one with no recipients. Do a print_r() and check the output. |
@alemadlei-tech It's instantiated like this. I couldn't find any documentation on how to do the personalization object.
|
You should be able to do
before sending it and from the output, if i'm not mistaken, you will see that the first item in the personalization contains no recipients. Also, I didn't find any documentation for it either, but what I did is go trough the code and found about that. |
Yes - you're right. In this case, there's 3 personalization objects.
|
@gavrichards, yes, but you need to add something to the email in the constructor. Check the constructor logic, you should be able to set the subject for the email and that would cause the personalization object to remain empty. |
Thanks for helping out @alemadlei-tech! Please let us know if you run into further issues @gavrichards. |
@alemadlei-tech Even if you add the subject to the constructor, you still get an error saying
This is because the first personalization object just contains the subject, and then the other two personalization objects contain a populated I think ultimately what I set out to do originally isn't going to work with this new SDK. I think it would be best if I reconsidered the approach completely. |
I've got this working, but it's a bit long-winded.
I have a related question now though. I'm trying to add a custom arg.
My problem is whenever I call this, it always adds the custom arg to the first personalization object. |
Thanks for sharing your solution @gavrichards! I think this is the function you need for global custom arguments. |
@thinkingserious Thanks - so the explanation comment on |
Yes, thanks for catching that! I'm going to classify this issue as a bug and put on our backlog for a fix. For this issue to gain priority in our backlog, we need additional +1's or a PR. When we receive a PR, that provides the biggest jump in priority. |
Thanks @thinkingserious :) |
We're finally upgrading from SDK v2.8 to v7 🎉
In our wrapper for the old version, we had this which handles sending an email either with single/multiple recipients in the 'To' line, or sending the email separately so each recipient only sees their own address in the To line.
Is there an equivalent for v7? Or should we instead be sending completely independent emails?
Any help would be appreciated.
The text was updated successfully, but these errors were encountered: