Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#325 2020-12-22 20:22:51

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,436
Website GitHub

Re: mem_postmaster - Postmaster Revamp

I’ve taken a stab at modernising mem_postmaster in my official unofficial fork. Things this is NOT:

  • A brand new thing. It is just some band-aid to get it working on newer (Txp 4.7+) installations.
  • Long-term supported. I’ll get it to a point where it works and patch a few bugs here and there but I’m not intending to grow features. For that, its completely new spin-off smd_newsletter will take over.

But things this IS:

  • More robust – fewer runtime errors/warnings. Fewer (hopefully no) installation errors. Although PHP 8 might throw a curveball here.
  • Able to send HTML email, although currently I misinterpreted how it worked and introduced a different way of working via parallel forms. I need to back-fill this with <txp:bab_pm_mime> after Yiannis kindly showed me how it was supposed to be used (thank you).
  • Able to send mail via PHPMailer if you add it to your /textpattern/vendors directory. It’ll automatically pick it up and use it to send mail internally via mail(). In a few commits’ time it’ll be able to also route mail via a third party SMTP server if you define a few hidden prefs containing the credentials. More info will be forthcoming on that.
  • Able to integrate with other plugins/modules to offer additional functionality, such as different encoding/filtering of prepared content prior to mailing out. There’s a callback (name not finalised yet) that enables this facility.

No compiled plugin is available yet but the code is freely available on GitHub and can be copied and pasted over your existing mem_postmaster, providing your plugin is of type 5. Change it in phpMyAdmin if necessary. And backup first!


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#326 2020-12-23 04:59:55

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,081
Website GitHub Mastodon Twitter

Re: mem_postmaster - Postmaster Revamp

Hi Stef, Thanks so much for adopting this plugin. I’ll. be testing it and report back on this thread.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#327 2020-12-26 09:18:50

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,081
Website GitHub Mastodon Twitter

Re: mem_postmaster - Postmaster Revamp

Hi Stef
I was testing your latest postmaster official unofficial fork from github. I just copied/pasted it in my existing plugin which is type 5. After saving I visited the Articles tab which returned the following error:

Parse error: syntax error, unexpected '<', expecting end of file in /path/to/neme.org/textpattern/plugins/mem_postmaster/mem_postmaster.php on line 2


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#328 2020-12-26 10:04:46

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,436
Website GitHub

Re: mem_postmaster - Postmaster Revamp

Did you copy/paste the entire.php file in? If copying it, only grab the chunk between BEGIN and END PLUGIN CODE markers.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#329 2020-12-26 10:58:50

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,081
Website GitHub Mastodon Twitter

Re: mem_postmaster - Postmaster Revamp

Bloke wrote #327865:

Did you copy/paste the entire.php file in? If copying it, only grab the chunk between BEGIN and END PLUGIN CODE markers.

That stops the particular error but the emails sent have big issues

  1. They are totally unformatted; textile, txp, and html tags are not parsed
  2. they are ignoring the from email field set by postmaster.
  3. images are not embedded
  4. there is a problem with non Latin characters. Here is a snippet of what I received in my test mail.

&Tau;&eta;&nu; &Pi;&alpha;&rho;&alpha;&sigma;&kappa;&epsilon;&upsilon;&#942; 6 &Nu;&omicron;&epsilon;&mu;&beta;&rho;&#943;&omicron;&upsilon;, &sigma;&tau;&iota;&sigmaf; 7:30 &mu;.&mu;., to NeMe &#941;&chi;&epsilon;&iota; &tau;&eta; &mu;&epsilon;&gamma;&#940;&lambda;&eta; &chi;&alpha;&rho;&#940; &nu;&alpha; &sigma;&alpha;&sigmaf;

I can forward you one to see what they look like and another one to see how it should have looked.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#330 2022-10-17 04:04:49

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,081
Website GitHub Mastodon Twitter

Re: mem_postmaster - Postmaster Revamp

As we are steadily approaching 3000 subscribers, more of our emails end up in the spam folders of on line email providers, especially gmail. As such I reached out to them on Twitter, and they promptly directed me to support.google.com/a/answer/81126. I checked with our host, and they do support DMARC, SPF, and DKIM.

Could this plugin support these protocols?


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#331 2022-10-17 08:25:13

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,436
Website GitHub

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.

Txp Builders – finely-crafted code, design and Txp

Offline

#332 2022-10-17 17:01:16

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,081
Website GitHub Mastodon Twitter

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

planeth
Plugin Author
From: Nantes, France
Registered: 2009-03-19
Posts: 234
Website GitHub Mastodon

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

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,719
Website

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

planeth
Plugin Author
From: Nantes, France
Registered: 2009-03-19
Posts: 234
Website GitHub Mastodon

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

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,719
Website

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

Board footer

Powered by FluxBB