I am using EasyNewsletter with taskqueue and I have problems getting the right URL for the unregister link. The url is created using the address of localhost (127.0.0.1:8080/plone).
I am using:
Product.EasyNewsletter 3.0.6 with taskqueue
In front of plone I use HAProxy and varnish.
Is there a way to force the right domain name into the link?
The correct url is tightly coupled to the current request; in an asynchronous operation, you do not have a "current" request. Thus, you will need to pass on the correct base url to the asynchronous operation and there set up a request mockup with the correct base url.
I cannot tell you how you would do this in detail. It depends on how
EasyNewsletter accesses the request. It might e.g. use acquisition or
zope.globalrequest. The two approaches require different measures to set up the request mockup.
If you're talking about the unsubscribe link within the newsletter sent, you can register a
subscriber' for theProducts.EasyNewsletter.interfaces.IBeforePersonalizationEvent` and change whatever you feel like.
Try something like this:
"""Exchanging hostname for domain
if 'html' in event.data.keys():
event.data['html'] = replace_hostnames(event.data['html'])
Just found some time to work on it - and it works just perfect. Thanks for your help and excuse me for the delayed response.