Welcome Guest, Not a member yet? Register   Sign In
Sending Email in Background
#1

(This post was last modified: 12-14-2015, 06:40 PM by lzwdct.)

Hi,

My system needs to send email to many users, and it really takes time to send many users. I do not want users to wait that time.

_send_mail functions are in various controller file per purpose. Is there any way we can send email in background?

If I use exec(), how do we keep all user email list, and mailing contents?

Thanks in advance
Reply
#2

For background you can use CRON JOB.
You can store email addresses in database (MySQL or MariaDB etc...)
For email contents you can create Email Templates store it into sub folder and call these templates through CRON JOB.

Hope that helps.
No SEO spam
Reply
#3

I just made an outgoing mail queue that is very much like what solidcodes describes, only I am storing the entire body of the email in the database record. All f the connection details, from, to, reply to,etc. Cron runs once a minute to process the mail queue.
Reply
#4

@skunkbad

DRY? that's nice...
No SEO spam
Reply
#5

(12-14-2015, 07:57 PM)solidcodes Wrote: @skunkbad

DRY? that's nice...

Actually, what I created a Mail driver to queue up the emails, and it is a driver because it has the ability to send emails via CI or swiftmailer. We ran into a problem where the host was telling us that CI was causing our emails to fail, so had to implement swiftmailer.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB