mage-mzax / emarketing

Magento extension to create automated marketing campaigns that run for a set period of time and target customers determined by multiple filters.
Open Software License 3.0
26 stars 15 forks source link

Failed to parse template HTML #10

Open gil6 opened 7 years ago

gil6 commented 7 years ago

I have 2 campaigns running on Magento CE 1.9.3.1 (birthdays and after sale product comments) From time to time I get an error "Failed to parse template HTML" If I delete in the table mzax_emarketing_email_address the faulty email address and do manually the 2 tasks find & queue new recipients and prepare pending new recipients there is no error.

The message in mzax_emarketing_recipient_error table is

Failed to parse template HTML

#0 path-to-shop/app/code/community/Mzax/Emarketing/Model/Template.php(164): Mzax_Emarketing_Model_Template->parse('<!DOCTYPE html ...')
#1 path-to-shop/app/code/community/Mzax/Emarketing/Model/Medium/Email/Processor.php(244): Mzax_Emarketing_Model_Template->render(Array)
#2 path-to-shop/app/code/community/Mzax/Emarketing/Model/Medium/Email/Composer.php(320): Mzax_Emarketing_Model_Medium_Email_Processor->getBodyHtml()
#3 path-to-shop/app/code/community/Mzax/Emarketing/Model/Outbox/Email.php(324): Mzax_Emarketing_Model_Medium_Email_Composer->compose(false)
#4 path-to-shop/app/code/community/Mzax/Emarketing/Model/Medium/Email.php(283): Mzax_Emarketing_Model_Outbox_Email->render()
#5 path-to-shop/app/code/community/Mzax/Emarketing/Model/Medium/Abstract.php(101): Mzax_Emarketing_Model_Medium_Email->sendRecipient(Object(Mzax_Emarketing_Model_Recipient))
#6 path-to-shop/app/code/community/Mzax/Emarketing/Model/Campaign.php(976): Mzax_Emarketing_Model_Medium_Abstract->sendRecipients(Object(Mzax_Emarketing_Model_Campaign), Object(Varien_Object))
#7 path-to-shop/app/code/community/Mzax/Emarketing/Helper/Campaign.php(157): Mzax_Emarketing_Model_Campaign->sendRecipients(Array)
#8 path-to-shop/app/code/community/Mzax/Emarketing/Model/Observer/Cron.php(140): Mzax_Emarketing_Helper_Campaign->sendRecipients(Array)
#9 [internal function]: Mzax_Emarketing_Model_Observer_Cron->sendRecipients(Object(Mage_Cron_Model_Schedule))
#10 path-to-shop/app/code/core/Mage/Cron/Model/Observer.php(326): call_user_func_array(Array, Array)
#11 path-to-shop/app/code/core/Mage/Cron/Model/Observer.php(72): Mage_Cron_Model_Observer->_processJob(Object(Mage_Cron_Model_Schedule), Object(Mage_Core_Model_Config_Element))
#12 path-to-shop/app/code/core/Mage/Core/Model/App.php(1358): Mage_Cron_Model_Observer->dispatch(Object(Varien_Event_Observer))
#13 path-to-shop/app/code/core/Mage/Core/Model/App.php(1337): Mage_Core_Model_App->_callObserverMethod(Object(Mage_Cron_Model_Observer), 'dispatch', Object(Varien_Event_Observer))
#14 path-to-shop/app/Mage.php(448): Mage_Core_Model_App->dispatchEvent('default', Array)
#15 path-to-shop/cron.php(78): Mage::dispatchEvent('default')
#16 {main}
jsiefer commented 7 years ago

Hi @gil6

The error occurred when parsing the email template, at this point there should not be any recipient based data involved. It is weird that it only fails for some recipient, because technical it should fail for all emails.

When saving the template a validation check is happening, to make sure that the template can be parsed, to prevent that issue.

Is their chance that you can provide me with your template and your campaign preset, feel free to use a private channel for that (email)

gil6 commented 7 years ago

Hi Jacob,

Here is the files…

Since some days, the birthday mailing run fine.

It is only the comments mailing who have some days all email errors

Thanks for your help…

Gilles

template.html.zip

Bonjour {{var order.customer_firstname}},

Vous souvenez-vous de moi ?

Vous avez récemment commandé les articles ci-dessous et je me demandais si vous pourriez m'écrire vos impressions (suivre le lien sur le produit, dans la boutique sous les images, onglet commentaires).

{{block type="mzax_emarketing/template" area="frontend" template="mzax/email/order-items.phtml" order="$order"}}

En espérant que ces produits vous plaisent,

Avec mes remerciements,

Morgane

Joyeux Anniversaire {{var customer.name}},

L'équipe de la boutique {{config path="general/store_information/name"}} vous souhaite un excellent anniversaire !

 

Pour cette occasion, nous vous offrons un

bon d'achat de 20 €


Votre coupon : {{coupon rule="5" length="10" dash="5" expire="168" prefix="A-"}} à indiquer dans le panier.
Valable 7 jours, pour toute commande de 100 € ou plus.

jsiefer commented 7 years ago

Hi @gil6,

what do you mean by:

It is only the comments mailing who have some days all email errors not quite following you here.

The template you send looked fine, I don't see any issues there.

gil6 commented 7 years ago

Hi Jacob,

I mean that I have 2 mailings : birthdays and comments.

Birthdays have no errors since 1-2 weeks.

For comments mailing it is more often in error.

And when it is in error, all the emails prepared that day are in error.

Hope it is more clear now…

Regards,

Gilles

De : Jacob [mailto:notifications@github.com] Envoyé : mardi, 20 décembre 2016 20:17 À : mage-mzax/emarketing Cc : gil6; Mention Objet : Re: [mage-mzax/emarketing] Failed to parse template HTML (#10)

Hi @gil6 https://github.com/gil6 ,

what do you mean by:

It is only the comments mailing who have some days all email errors not quite following you here.

The template you send looked fine, I don't see any issues there.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mage-mzax/emarketing/issues/10#issuecomment-268331560 , or mute the thread https://github.com/notifications/unsubscribe-auth/AXTHhz0jKXHCnHZYOYYv3q4gOjUe8Yyiks5rKCmsgaJpZM4LGYse . https://github.com/notifications/beacon/AXTHh_KBvL3TBCTXmU7IusHjNPFdQADoks5rKCmsgaJpZM4LGYse.gif

gil6 commented 7 years ago

Hi Jacob,

Every day I have to check my 2 emarketing mailings.

It goes bad most of the time, but not always…

I have to delete the records in mzax_emarketing_email_address And then I do manually the 2 tasks, it goes always out correctly.

Please let me know what shoud I try…

Regards,

Gilles

gil6 commented 7 years ago

Hi Jacob, Let me know how can I help solving... Regards, Gilles

jsiefer commented 7 years ago

hi @gil6, I have released a new version fixing a bunch of minor issues, not sure if it will help you but maybe we can start from there.

gil6 commented 7 years ago

Hi Jacob,

Thank you for your message.

I have updated your extension… I will let you know if it solve or not my issue…

Best regards,

Gilles

De : Jacob [mailto:notifications@github.com] Envoyé : samedi, 18 février 2017 17:23 À : mage-mzax/emarketing Cc : gil6; Mention Objet : Re: [mage-mzax/emarketing] Failed to parse template HTML (#10)

hi @gil6 https://github.com/gil6 , I have released a new version fixing a bunch of minor issues, not sure if it will help you but maybe we can start from there.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mage-mzax/emarketing/issues/10#issuecomment-280856074 , or mute the thread https://github.com/notifications/unsubscribe-auth/AXTHh2K1tLnMJ1-TJYLSfJbzsbCzyRq3ks5rdxrugaJpZM4LGYse . https://github.com/notifications/beacon/AXTHh6-sU0USobNb4osDaXJgg-6cjQ6lks5rdxrugaJpZM4LGYse.gif

gil6 commented 7 years ago

Hi Jacob,

No, unfortunately it has not solved the problem…

I have 2 campaigns executing each morning at 02:00. Could it be because they run at the same time ?

Because If I run manually, it works…

Best regards,

Gilles

De : Gilles Savary [mailto:info@gsavary.net] Envoyé : lundi, 20 février 2017 20:00 À : 'mage-mzax/emarketing'; 'mage-mzax/emarketing' Cc : 'Mention' Objet : RE: [mage-mzax/emarketing] Failed to parse template HTML (#10)

Hi Jacob,

Thank you for your message.

I have updated your extension… I will let you know if it solve or not my issue…

Best regards,

Gilles

De : Jacob [mailto:notifications@githu mailto:notifications@github.com b.com] Envoyé : samedi, 18 février 2017 17:23 À : mage-mzax/emarketing Cc : gil6; Mention Objet : Re: [mage-mzax/emarketing] Failed to parse template HTML (#10)

hi @gil6 https://github.com/gil6 , I have released a new version fixing a bunch of minor issues, not sure if it will help you but maybe we can start from there.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mage-mzax/emarketing/issues/10#issuecomment-280856074 , or mute the thread https://github.com/notifications/unsubscribe-auth/AXTHh2K1tLnMJ1-TJYLSfJbzsbCzyRq3ks5rdxrugaJpZM4LGYse . https://github.com/notifications/beacon/AXTHh6-sU0USobNb4osDaXJgg-6cjQ6lks5rdxrugaJpZM4LGYse.gif

jsiefer commented 7 years ago

Hi @gil6

I have create some integration tests and tried to reproduce your issue - but no success so far. I fed the system with faulty data etc, It does create an entry in the error log and continues with the next recipient without blocking the system which seems correct to me.

jsiefer commented 7 years ago

I am adding the XML error messages to the error log. Maybe that will reveal the actual issue.

gil6 commented 7 years ago

Hi Jacob,

Thank you for your extension, it is really great.

I was thinking of an improvement : The possibility to visualize the number of click for each link zone of the email.

This would help to know what was the most/least important message link…

PS: I have still from time to time the sending error.

Best Regards,

Gilles

De : Jacob [mailto:notifications@github.com] Envoyé : dimanche, 2 avril 2017 15:14 À : mage-mzax/emarketing Cc : gil6; Mention Objet : Re: [mage-mzax/emarketing] Failed to parse template HTML (#10)

I am adding the XML error messages to the error log. Maybe that will reveal the actual issue.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mage-mzax/emarketing/issues/10#issuecomment-290985622 , or mute the thread https://github.com/notifications/unsubscribe-auth/AXTHhy8UTSLBKerjE8uRsQYa11t-NYYpks5rr58bgaJpZM4LGYse . https://github.com/notifications/beacon/AXTHh0caf2ZTuQ598bqBvbGzlyMZo80Tks5rr58bgaJpZM4LGYse.gif