Page 4 of 4

email array to sendgrid

Posted: Sun Apr 27, 2014 2:53 am
by Nathan Morin

Casey-

I figured it out!! So I set the settings as Alena instructed. Still didn't work. I looked at some different code elsewhere. I saw that in similar lines of code no one put "to[]": It was always "to" : [ ]

So I changed

sendgrid_mailsend.execute({data: {"to[]": [email1, email2, email3, email4]} });

to

sendgrid_mailsend.execute({data: {"to": [email1, email2, email3, email4]} });

Very subtle difference but I think it might have been creating an array within an array? Not sure. But I can confirm that I have successfully received the emails at every email address that I wanted.

Cheers,

Nathan


email array to sendgrid

Posted: Sun Apr 27, 2014 2:55 am
by Nathan Morin

The "to[]": needs to be changed to "to": for it to work.

Code should read:

sendgrid_mailsend.execute({data: {"to": ["a href="mailto:yourfirstEmail@sss.com" rel="nofollow"yourfirstEmail@sss.com/a", "a href="mailto:yoursecondEmail@sss.com" rel="nofollow"yoursecondEmail@sss.com/a"]} });

Alena has further settings that I used to make this work below.


email array to sendgrid

Posted: Sun Apr 27, 2014 9:59 pm
by Alena Prykhodko

Hi Nathan,

Suggestion above should work (we have tested it).

Please make screen shots of your service and code.

Or just share your app with a href="mailto:support@appery.io" rel="nofollow"support@appery.io/a, tell us its name so we can take a look.


email array to sendgrid

Posted: Sun Apr 27, 2014 10:00 pm
by Nathan Morin

Alena-

Please see my comments above. I fixed the issue already by updating the code as you can see. There is no need for support as the issue has been resolved. Thanks for the follow up.

Cheers,

Nathan


email array to sendgrid

Posted: Sun Apr 27, 2014 10:02 pm
by Alena Prykhodko

Good for you. Thanks for update :)


email array to sendgrid

Posted: Mon Apr 28, 2014 5:04 am
by casey palmer

Hi Nathan,

Will give this a try, Thanks for the info. Looks like you really put in the work on this one.


email array to sendgrid

Posted: Thu Aug 07, 2014 5:38 am
by Aeneas McBurney

Hi, I am also trying to send multiple emails based on an email string separated by ; I have tried both "to" and "to[]" in the code but its still only sending to the first email address in the list.

My code is attached. Any ideas what I'm doing wrong?

Image


email array to sendgrid

Posted: Thu Aug 07, 2014 9:50 pm
by Yurii Orishchuk

Hi Aeneas,

Please follow this solution(given above):

1 Open "SendGrd_MailSend" service.

2 Change "URL" to: "https://api.sendgrid.com/api/mail.sen..."

3 change "Method" to "post".

4 change "Content Type" to "x-www-form-urlencoded".

see details for these steps on this screen shot: http://prntscr.com/3d5eze/direct

After you will make this changes you can send email to multiple users via know code:

pre

sendgrid_mailsend.execute({data: {"subject": "a_13", "to[]": ["firstEmail@domain.com", "secondEmail@domain.com"] } });

/pre

It's necessary to do these all steps not just one(last).

Regards.


email array to sendgrid

Posted: Thu Aug 07, 2014 10:27 pm
by Aeneas McBurney

Thanks I did all of the steps and it works well!!