Post by JIMSLITA » Wed Apr 09, 2014 2:51 pm

Hi there

Just wondering if either there is anyone out there who already has this implemented correctly or who knows more than me (not hard :-\ ) on where to make the necessary code change.

I am using smpt (gmail) for all admin emails but have Newsletter Enhancements v3 http://www.opencart.com/index.php?route ... on_id=4776 installed for sending newsletters to our mailing list. We use amazon SES for the delivery of these newsletters, because we send quite a few. With amazon SES we have a daily sending quota of 50,000 mails with a max send rate of 14 mails/second which is more than sufficient. Unfortunately, whilst Newsletter Enhancements v3 (NE3) has many features - including allowing us to set different mail settings for the newsletters than we use for our admin mails (gmail), the throttling settings are based on using a cron job so the smallest increment for the setting is x per minute. This means we can only send 14 mails per minute rather than 14 mails per second: which obviously slows things down a lot!

We are using both smpt (gmail) and smpt (amazon.ses) in conjunction with the free phpmailer module http://forum.opencart.com/viewtopic.php?t=45961 and I would like to try and use throttle settings for all mails using the phpmailer class rather than using the cron job method.

Looking at the website for the phpmailer class I can see that there are 2 changes required to avoid timeouts with larger mailing lists and also throttle settings to avoid flooding the mail server which are detailed, with the necessary code, here (timeouts) http://phpmailer.worxware.com/index.php?pg=tip_ext and here (throttling) http://phpmailer.worxware.com/index.php?pg=tip_pause but I can't seem to work out where/how I need to add them to our current set up. I don't need fancy admin settings - we could hard code our settings based on our current SES limits.

If someone has this set up already or would care to advise and how to add the two code snippets above to the phpmailer class I would be very grateful to hear from you.

Thanks!

OC v 1.5.4 with alot of tweaks,exts & mods.


User avatar
New member

Posts

Joined
Fri Feb 08, 2013 3:49 pm

Post by JIMSLITA » Fri Apr 11, 2014 5:46 pm

A bit of a bump really - I have been trying implementing this myself, but it is very hard to know if I am doing the right thing, breaking the code or doing nothing at all because it only relates to emails (which are generally still sent unless I did something really catastrophic!)

The upside of getting this right for other users with large mailing lists is a significant saving on mailshots - the amazon SMS tarifs are $0.10CTS per 1000 mails sent - yes 10 US cents for 1000 emails compared with about 2 cents per mail with Mailchimp.

OC v 1.5.4 with alot of tweaks,exts & mods.


User avatar
New member

Posts

Joined
Fri Feb 08, 2013 3:49 pm

Post by zaidladha » Fri Dec 11, 2015 1:42 pm

Tell me you got this figured out....I am using newsletter enhancements, sometimes it craps out at 50 emails, sometimes around 350, and sometimes it even sends out several thousand (entire list). I haven't figured out why it does it, so if you have figured it out please let me know!

Active Member

Posts

Joined
Wed Jun 05, 2013 3:07 pm

Post by JIMSLITA » Fri Dec 11, 2015 5:39 pm

I have it up and running using mail enhancements and amazons SES mail service now. Are you sending using amazon or just via your own servers web mail or gmail or the like?

OC v 1.5.4 with alot of tweaks,exts & mods.


User avatar
New member

Posts

Joined
Fri Feb 08, 2013 3:49 pm

Post by zaidladha » Sat Dec 12, 2015 6:21 am

I am using amazon SES.

I figured out how to add the cron job via ssh, but it seems to have crashed when trying to send out a large number of emails. It ended up sending 12,000 emails to 2800 people (roughly 6 per person). The cron job just kept re-running the queue. I have reduced the number of emails per minute, and it seems to be working for smaller lists. I will have to keep an eye on it when I run the next big list.

How many emails do you have set per minute? My ses lets me send 14/second, but evidently the script can't handle the speed or queue of 500/minute (even though SES can handle 840/minute). I reduced it down to 30, it will take a couple hours to send the email, but that should be ok if its at night.

Active Member

Posts

Joined
Wed Jun 05, 2013 3:07 pm

Post by JIMSLITA » Sat Dec 12, 2015 7:06 pm

OK then I ended up working on the basis that the amazon limits (per second) must be based on an average as I couldn't get cron to work on less than a per minute basis. In the NE module settings I have:

use cron: yes

emails per iteration: 100 (if you can send 14/sec then in theory you could send upto 840/minute so don't try any more than that - try playing with this number until; you get a rate which suits you and that doesn't exceed the 840 sending limit) I am sending to a list of 5000 but I only send one newsletter at a time to this list - you'll have to see what works for you situation.

interval: 1

then under General:

Retries 3
cron command: */5 * * * * /usr/bin/wget -o /dev/null -q "http://www.yoururl/index.php?route=ne/c ... xxxxxxxxxx" >/dev/null 2>&1

set up the cron job via cPanel and see how you get on.

Hope that helps a bit!

Jim

OC v 1.5.4 with alot of tweaks,exts & mods.


User avatar
New member

Posts

Joined
Fri Feb 08, 2013 3:49 pm

Post by zaidladha » Sat Dec 12, 2015 8:38 pm

Ahh thanks. yah one of my issues was I don't have cpanel as I'm on a dedicated host and haven't paid for one yet. SSH was my alternative to load the cron command directly.

Active Member

Posts

Joined
Wed Jun 05, 2013 3:07 pm
Who is online

Users browsing this forum: No registered users and 31 guests