Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Send Mailchimp newsletter to List via PHP

Is there a way to send a self-designed HTML and CSS email to a Mailchimp List from a .php page? I want to integrate a newsletter function to an admin panel with my own newsletter template and send it from there.

I don't wanna have to log in to Mailchimp every time I wanna send an email, especially since the template will be the same each and every time.

like image 220
Alin Avatar asked Jul 10 '15 13:07

Alin


People also ask

How does MailChimp integrate with PHP?

Go to mailchimp select account, you will find extras dropdown. Select API keys and in the bottom left you will find a button Create A Key . Click on it and your api key is created. You have to copy the API Key under the API Key header.

Can MailChimp send to distribution list?

To send a distribution list to MailChimp: In the Global Navigation bar, click Marketing. Click the Distribution Lists tab. Search for and click the distribution list that you want to use.

Can you send newsletters from MailChimp?

After you've completed the To, From, Subject, and Content sections of the campaign builder, you should see a green checkmark next to each. That means you're ready to send your sample newsletter to yourself. To send your sample newsletter, follow these steps. Click Send.


2 Answers

If you don't want to upload your template to Mailchimp and send a campaign by hitting their API, Mandrill (as @Whymarrh mentioned above in the comments) may be a good option.

Although it's meant for transactional emails (welcome, password recovery, etc), you can send to up to 1000 users at a time through SMTP. Plus you can connect your Mailchimp account to your Mandrill one in the Integrations section to track recipient activity.

My suggestion would be to install the Mandrill PHP API client, upload your template to Mandrill, hit the Mailchimp API for your user list, and then feed that into a Mandrill send-template call that you trigger through your admin panel. (Pro tip on sending mass emails: Mandrill sending to multiple people as separate message via the REST API).

like image 136
lydiat Avatar answered Nov 12 '22 06:11

lydiat


Yes, you can. The details and examples from MailChimp are available by logging in to their control panel. Use their form fields, style your own form.

<form action='http://xxxx.xxxxlist-manage.com/subscribe' method='post'>
    <p><input type="email" value="" name="EMAIL" class="required email" id="mce-EMAIL" placeholder="enter email address"></p>
    <p><input type="submit" value="Sign Up" name="subscribe" id="mc-embedded-subscribe" class="btn"></p>
    <input type='hidden' name='u' value='xxxxxxx'>
    <input type='hidden' name='id' value='xxxxxxx'>
</form>
like image 44
MaggsWeb Avatar answered Nov 12 '22 05:11

MaggsWeb