New Customer Emails not being sent

Andy W

Member
I've got the API working to add new customers, without any problems. However, the email in which they have to click the link to confirm their address is never sent. It's showing in Backend > Misc > Transactional Emails as 'Unsent'.

All other crons seem to be working fine, and I've tried switching the emails to be sent direct instead of queueing as transactional - but neither setting works. Have you any idea what I should check next?
 

twisted1919

Administrator
Staff member
have you tried running the send-transactional-emails command by hand from command line a few times ?
 

Andy W

Member
Strange, but the email has now come through - exactly one hour after it should have been sent. Customer added through api at 3:43pm, transactional email sent at 4:54pm (both GMT).

It's now showing as sent in the transactional email log. The cron job for the transactional email is set every 2 minutes, and I must have ran it 15 times manually. The server time is set at GMT - which is one hour behind my proper timezone (GMT+1). Would there be something in Mailwizz that meant it didn't even try to send this email until the later time (1 hour later)?
 

twisted1919

Administrator
Staff member
@Andy W - Afaik transactional emails will always use UTC+00:00, so when you schedule one, if you want it sent imediatly, maybe schedule it in the past.
 

Andy W

Member
Yes I'll try that - although this isn't strictly a transactional email. It's the one triggered internally by the registration of the customer...
 

Andy W

Member
Looks like I've fixed this issue. For anyone else interested in doing the same. In file apps/common/models/TransactionalEmail.php line 130 change:

$this->send_at = date('Y-m-d H:i:s');

to this:

$newdate = strtotime('-1 day', strtotime(date('Y-m-d H:i:s'))) ;
$this->send_at = date('Y-m-d H:i:s', $newdate );


Then, if a transactional email has no send date/time set, it defaults it to the current time - 1 day. In my case this meant that customer registration emails were then sent out immediately instead of waiting for 1 hour.

I'm not a developer, so there may be a better way to do this :)
 
Top