Nathan Morin
Posts: 0
Joined: Thu Sep 05, 2013 6:12 am

email array to sendgrid

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

Nathan Morin
Posts: 0
Joined: Thu Sep 05, 2013 6:12 am

email array to sendgrid

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.

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

email array to sendgrid

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.

Nathan Morin
Posts: 0
Joined: Thu Sep 05, 2013 6:12 am

email array to sendgrid

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

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

email array to sendgrid

Good for you. Thanks for update :)

casey palmer
Posts: 0
Joined: Tue Mar 18, 2014 6:32 am

email array to sendgrid

Hi Nathan,

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

Aeneas McBurney
Posts: 0
Joined: Mon Jun 16, 2014 7:49 am

email array to sendgrid

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

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

email array to sendgrid

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.

Aeneas McBurney
Posts: 0
Joined: Mon Jun 16, 2014 7:49 am

email array to sendgrid

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

Return to “Issues”