Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#331 2022-10-17 08:25:13
Re: mem_postmaster - Postmaster Revamp
SPF and DMARC should be able to be configured independently of the plugin. All you’re doing is adding headers to your email addresses saying you trust yourself, and what to do in the event that a message fails delivery.
DKIM is a little more involved as it requires the public key to be added to all messages. So the plugin would need modifying to read that from some pref.
Alternatively, if you’re happy to copy some of the dev code to your site, SMTP email protocol support in dev lets you specify your DKIM key in config.php, which is then passed on. I can advise what you need to do, but it’s fairly involved.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
#332 2022-10-17 17:01:16
Re: mem_postmaster - Postmaster Revamp
Bloke wrote #333973:
Alternatively, if you’re happy to copy some of the dev code to your site, SMTP email protocol support in dev lets you specify your DKIM key in config.php, which is then passed on. I can advise what you need to do, but it’s fairly involved.
Hi Stef
hanks so much for your response. The problem here may be with our host’s limits for SMTP email. I’ll have to investigate it.
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
#333 2024-09-12 17:09:38
Re: mem_postmaster - Postmaster Revamp
Thank you Stef for this offical nonOfficial postmaster !
I’m trying to setup a unsubscribe page, and I’m running into a problem I can’t figure out.
I’m running Textpattern-4.9.0-beta.1
This is the markup for the page
<txp:com_connect to="<admin_email>"
label="Se désabonner"
thanks="C’est fait ! Vous êtes désabonné.">
<notextile><txp:variable name="hasSubcribeId" escape="tidy,trim">
<txp:php>echo $_GET['uid'] ?? '';</txp:php>
</txp:variable></notextile>
<txp:if_variable name="hasSubcribeId" value="">
<txp:com_connect_email name="subscriberEmail" label="Email" placeholder="email"
break=""
autocomplete="email"
required/>
<txp:com_connect_secret name="unsubscribeID" value="" />
<txp:else/>
<txp:com_connect_secret name="unsubscribeID">
<txp:variable name="hasSubcribeId"/>
</txp:com_connect_secret>
<txp:hide><!-- trying to give a subscriberEmail to bypass from_or_to_address_missing error-->
</txp:hide>
<txp:com_connect_secret name="subscriberEmail" value="<admin_email>"/>
</txp:if_variable>
<txp:com_connect_secret name="doSubscribe" value=""/>
<txp:com_connect_secret name="unsubscribe" value="on"/>
<button type="submit">Se désabonner</button>
</txp:com_connect>
If the page is accessed with no uid parameter, it shows an email field, the plugin does it thing and on return, the success message is shown.
But, if the page is accessed with a uid parameter, there is no email field, the plugin does remove the records but an error massage is returned from_or_to_address_missing
Is this the right way to setup an unsubscribe page ?
What am I missing ?
Last edited by planeth (2024-09-12 17:12:08)
Offline
#334 2024-09-12 21:21:37
Re: mem_postmaster - Postmaster Revamp
Not an answer to your question, but this bit:
<notextile><txp:variable name="hasSubcribeId" escape="tidy,trim">
<txp:php>echo $_GET['uid'] ?? '';</txp:php>
</txp:variable></notextile>
you should be able to do as:
<txp:variable name="hasSubcribeId"><txp:page_url type="uid" /></txp:variable>
and it will be sanitised for you.
Presumably <admin_email> is just a placeholder? Or is that part of the plugin?
TXP Builders – finely-crafted code, design and txp
Offline
#335 2024-09-13 07:04:35
Re: mem_postmaster - Postmaster Revamp
Thanks Jakob ! It was not clear in the doc if the type attribute can target a query parameter.
And yes, <admin_email> is a placeholder.
I think I saw somewhere in the forum that you are using the plugin too. How are you managing the unsubscribe part ?
Offline
#336 2024-09-13 10:50:59
Re: mem_postmaster - Postmaster Revamp
Sorry, no. It’s not one I’ve used but Yiannis (colak) does use it.
Otherwise your logic looks sound to me, especially if the unsubscribe does happen. Does the message only show in debug mode? If so, it may only be a nuisance but no-one sees it when the site is set to live.
TXP Builders – finely-crafted code, design and txp
Offline
#337 2024-09-13 14:14:58
Re: mem_postmaster - Postmaster Revamp
jakob wrote #337851:
Does the message only show in debug mode? If so, it may only be a nuisance but no-one sees it when the site is set to live.
Yes I was in debug mode. Just changed to live to see what happens. Unfortunately, the error message still shows :/
Offline
#338 2024-09-13 15:01:24
Re: mem_postmaster - Postmaster Revamp
As far as I recall, you don’t need to submit a form to unsubscribe. You should only need to detect the presence of the UID and then call one of the postmaster tags to action it. It’s been a while since I looked, but that is how I thought it worked.
If there is no UID, then you are correct that you can use a form to capture the email which postmaster can then look up to get the UID and unsubscribe them.
I can check later if I get a moment.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
#339 2024-09-13 19:16:54
Re: mem_postmaster - Postmaster Revamp
Bloke wrote #337854:
As far as I recall, you don’t need to submit a form to unsubscribe. You should only need to detect the presence of the UID and then call one of the postmaster tags to action it.
oohh, aahh, I missed that !
So I could do :
<txp:com_connect thing>
<txp:if_variable name="hasSubcribeId" value="">
<-- process the email -->
<txp:else/>
<txp:com_connect_secret name="unsubscribeID">
<txp:bab_pm_unsubscribe />
</txp:if_variable>
I’ll test that, and I’ll report back
Offline
#340 2024-09-13 20:55:40
Re: mem_postmaster - Postmaster Revamp
In theory, yes. I can’t remember if it actually works Iike that or if that’s how my replacement plugin I started (and have yet to finish) building works. Because that’s how I’d approach it.
Yiannis might know more, as he has this working on his site. Although I don’t know.of unsub requests are handled automatically by the plugin or if he gets a notification and then manually scrubs them from the lists.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
#341 2024-09-16 07:58:24
Re: mem_postmaster - Postmaster Revamp
OK, reporting back :D
below is the working code that I used :
<txp:variable name="hasSubcribeId"><txp:page_url type="uid"/></txp:variable>
<txp:if_variable name="hasSubcribeId" value="">
<txp:com_connect to="<admin_email>"
label="Se désabonner"
thanks="C’est fait ! Vous êtes désabonné.">
<txp:com_connect_email name="subscriberEmail" label="Email" placeholder="email"
break=""
autocomplete="email"
required />
<txp:com_connect_secret name="unsubscribeID" value=""/>
<txp:com_connect_secret name="doSubscribe" value=""/>
<txp:com_connect_secret name="unsubscribe" value="on"/>
<button type="submit">Se désabonner</button>
</txp:com_connect>
<txp:else/>
<txp:bab_pm_unsubscribe/>
</txp:if_variable>
I found that bab_pm_unsubscribe was missing in the tag registry.
Added ->register('bab_pm_unsubscribe') at line 17.
The unsub request is handled automatiquely by bab_pm_unsubscribe.
But there is no success message, the plugin only provide an error message in case of error.
Is there a hook I could use to provide a feedback ?
Thanks
Offline
#342 2024-09-16 09:23:33
Re: mem_postmaster - Postmaster Revamp
planeth wrote #337868:
Is there a hook I could use to provide a feedback ?
I haven’t checked and I don’t think there is, but in the meantime…
...
<txp:else/>
<txp:bab_pm_unsubscribe/>
<p>Your unsubscription request has been received. Sorry to see you go. Remember you can resubscribe at any time.</p>
</txp:if_variable>
And if you wanted to check if it returned anything, maybe this (untested) :
...
<txp:else/>
<txp:evaluate not test="bab_pm_unsubscribe">
<txp:bab_pm_unsubscribe/>
<p>Your unsubscription request has been received. Sorry to see you go. Remember you can resubscribe at any time.</p>
</txp:evaluate>
</txp:if_variable>
The theory being that if it returns something it’ll be an error, which means the test will succeed, so we invert the logic with not to make it only print the message if the tag returns empty.
I’m unsure if not works that way in the evaluate tag.
YMMV.
Last edited by Bloke (2024-09-16 09:28:57)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
#343 2024-09-16 13:18:49
Re: mem_postmaster - Postmaster Revamp
The first option works.
The second not at all.
Problem solved :D Thanks Stef
Offline
#344 2024-09-16 15:37:24
Re: mem_postmaster - Postmaster Revamp
Interesting case. You should be able to solve it with
<txp:evaluate query test='<txp:bab_pm_unsubscribe/>'>
<p>You are in trouble here.</p>
<txp:else />
<p>Your unsubscription request has been received. Sorry to see you go. Remember you can resubscribe at any time.</p>
</txp:evaluate>
Offline
#345 2024-09-16 16:39:39
Re: mem_postmaster - Postmaster Revamp
I was close! Thanks, Oleg. Forgot we need to put the whole expression in the test attribute. Nice one.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline