0

I'm trying to connect my Magento newsletter users list to a third party email marketing service and sync data (from service to Magento) through a webhook. However, the marketing service is asking me for the unsusbcribe callback URL, I don't know what to say. Any help with this is welcome.

1

When integrating a third party service you've got two options.

1: Service sends newsletter > Unsubscribe link is handled by the service & user is unsubscribed there > they sync the unsubscribe information back to your site

2: Service sends newsletter > Unsubscribe link is handled by your Magento store > You sync the unsubscribe information back to the service

If they are asking you for a callback URL, it sounds like you are using option 1. This can't be handled with the default unsubscribe controller. You need to create a new action where the subscriber_id or email address is passed as a parameter. This should also be password protected.

Which service are you using? Some of them also offer a Magento extension to handle it.

EDIT: As the service InInbox is used, the extension could solve the issue. http://www.magentocommerce.com/magento-connect/official-ininbox-email-marketing-integration.html

  • Thanks RobM84. My desirable (best) option is #2, however, third party services seem they prefer stores to work under #1 process (they say it's mandatory that you use the Service unsubscription links!). So I'm trying to build the #1 option and getting synced with the Service unsubscriptions through a webhook. The service I'm now working with is InInbox, and yes they offer a Magento extension that enables your Magento list to be transferred (only one way) to the Service List. – Frank Oct 27 '14 at 13:49
  • There is an extension for ininbox. I don't know about the quality, but it sounds like it could solve your issue. magentocommerce.com/magento-connect/… – RobM84 Oct 27 '14 at 17:34
  • yep, there is one extension for Ininbox but only for transferring users to the ininbox service, not bi-directional sync though. – Frank Oct 27 '14 at 18:29
0

unsubscribe action takes place in SubscriberController.php that comes inside the module Mage_Newsletter. So by default url path for unsubscription of newsletter will looks like.

  <www.yourdomain.com>/newsletter/subscriber/unsubscribe

So first load this url and confirms it. Then use it.

  • I found this php file in: app/code/core/Mage/Newsletter/controllers/SubscriberController.php. Is the callback url: mydomain.com/app/code/core/Mage/Newsletter/controllers/…. The email marketing service does not seem to accept this url, though. – Frank Oct 27 '14 at 12:49
  • nope it is not like that. It is like mydomain.com/newsletter/subscriber/unsubscribe – Rajeev K Tomy Oct 27 '14 at 12:51
  • ok, but the third party service still doesn't like this link and send me a "Error! Webhook URL of unsubscription is invalid." I'm starting to lose the faith on this service (InInbox), since as I reported the issue to them they just offered an "affordable" customized development. – Frank Oct 27 '14 at 13:55
0

I know I am late here but still I want to share solution here.

I am using Magento 1.9. To add newsletter unsubscribe link in newsletter template here are following steps:

  1. Override the core file

/app/code/core/Mage/Newsletter/Model/Subscriber.php

by copy in local directory

/app/code/local/Mage/Newsletter/Model/Subscriber.php

  1. Open in editor to edit the code and seacrh the function sendConfirmationSuccessEmail() replace the code
$email->sendTransactional(
    Mage::getStoreConfig(self::XML_PATH_SUCCESS_EMAIL_TEMPLATE),
    Mage::getStoreConfig(self::XML_PATH_SUCCESS_EMAIL_IDENTITY),
    $this->getEmail(),
    $this->getName(),
    array('subscriber'=>$this)
);

with this

$email->sendTransactional(
    Mage::getStoreConfig(self::XML_PATH_SUCCESS_EMAIL_TEMPLATE),
    Mage::getStoreConfig(self::XML_PATH_SUCCESS_EMAIL_IDENTITY),
    $this->getEmail(),
    $this->getName(),
    array('subscriber'=>$this, 'unsubscribe' =>$this->getUnsubscriptionLink())
);
  1. and place this code in email template where you want to use unsubscribe link:

    <a href="{{var unsubscribe}}">Unsubscribe here</a>

That's it!

Hope this helps someone.

  • Useful answer, but for a different question. – Fabian Schmengler Dec 20 '15 at 13:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.