Moving Awocoupon + Acymailing to Joomla 5


  • Default avatar
    info14    
     5 months ago
    0

    Hello

    There is a Joomla 3 + Acymailing 5 + VM3 + Awocoupon site, where a mail template uses this:
    {awocoupon:cart[key]21|139|14|[na]|[na]|[na]|[na]}
    There is a custom script which fetches the mail data from the database, and runs this:
                    $class = acymailing_get('class.template');
                    JPluginHelper::importPlugin('acymailing');
                    $dispatcher = JDispatcher::getInstance();
                    $dispatcher->trigger('acymailing_replaceusertags', array(&$mail, &$receiver, true));
    This generates the coupon code, and the custom script can handle it (we don't send the mail directly, but passes it to an external manager)

    Also we're migrating this site to Joomla 5 + Acymailing 9 + VM4 + Awocopon. I purchased the AwoCoupon plugin for AcyMailing, but something might changed. I've already changed the trigger in the custom script to this:
    acym_trigger('replaceUserInformation', [&$mail, &$receiver, true]);

    Could you help me how should I change the {awocoupon:cart[key]21|139|14|[na]|[na]|[na]|[na]} part to get the same result?
  • Your avatar
    seyi    
     5 months ago
    0

    Hello,

    The breakdown of your tag is:
     cart[key]21: format the code in a specific type of way
    139: the coupon code to copy
    14: number of days until expiration

    In Acymailing 6+, the first part has been removed, format the coupon code in a specific way, so the new tag is:
    {awocoupon:139|expiration:14}