0

I would like to know if there is any existing implementation that sends mass email to a list of contacts using Sparkpost.

I am able to use API and PHP.

EnexoOnoma
  • 8,454
  • 18
  • 94
  • 179

2 Answers2

2

You can use php-sparkpost library as Jim Wright mentioned. However, you can take either of the following approach with your list:

1) You can use the Recipients List API to upload all of your recipients to SparkPost. Then send an email (transmission) using that recipient list. See this example to learn how to use transmission along with recipient list. This way you can literally send an email to thousands of recipients in, like, just 2 API calls (one to create recipients list, one to transmission api)

2) You can use inline recipients as shown in the example linked by Jim Write. However, there is a restriction in total payload size of transmission api (actually in content property of your json payload). So, you may have to split your transmissions into multiple API calls. And depending your total number of recipients/calls/frequency you may be subject to API rate limiting.

Regardless of which method you follow, I will strongly advise you to follow best practices suggested by SparkPost, specially (along with others) increase your traffic gradually and build up your reputation before you shoot thousands of emails.

HungryCoder
  • 7,506
  • 1
  • 38
  • 51
1

Check out php-sparkpost. I think that you should find the first example in the readme useful.

Also a related blog post by SparkPost.

Jim Wright
  • 5,905
  • 1
  • 15
  • 34