java - Sendgrid: Send multiple different emails in one request -


i'm using sendgrid java web api client website send mail through web api gateway. problem can send 1 message per request , have need send 1000-1500 messages @ time different in content, send them in loop. however, makes 1000-1500 api request slow.

is possible send multiple individual different emails in 1 request?

this bit of workaround, batch different emails 1 request using substitution property of x-smtpapi header. in email body, include substitution token, e.g. %content%. pass actual content in header, e.g.

{   "to": [     "john.doe@gmail.com",     "jane.doe@hotmail.com"   ],   "sub": {     "%content%": [       "here content email john.doe",       "and different content jane.doe"     ]   } } 

Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -