Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#196 2017-04-28 03:18:55

phiw13
Plugin Author
From: South-Western Japan
Registered: 2004-02-27
Posts: 3,637
Website

Re: zem_contact_reborn v4.5.0.0: contact mail form processing

maniqui wrote #305532:

This affects emails sent from any contact form (not only forms managed bu zem_contact_form): if the user filled in a yahoo.com …

I had similar problems with gmail.com addresses (at least I think it is the same; haven’t found any conclusive evidence or documentation though).

The solution is easy: use the from attribute in zem_contact_reborn to set a From: address. You will be able to reply to the sender, as when using the from attribute, zem_contact_reborn adds the Reply-to: header, and sets it to the sender’s email address.

Same solution for any contact-type script: the From: header should be set to your own contact address, and use the Reply-to: for the person who fills in the form.

Bloke: I wonder if it wouldn’t be a better solution to have a built-in solution: adding a special case in the plugin code so when the sender is using a yahoo.com address …

Why make it a special case? Make it the rule, and always add the Reply-to: header (and allow for override if the user has special needs).


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
phiw13 on Codeberg

Offline

#197 2017-04-28 09:03:39

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,443
Website GitHub

Re: zem_contact_reborn v4.5.0.0: contact mail form processing

phiw13 wrote #305533:

the From: header should be set to your own contact address, and use the Reply-to: for the person who fills in the form.

If this’ll make it easier and more robust, the plugin should try to do this by default. The assumption would be that there’s an email field in the form. And the form designer used <txp:zem_contact_email /> instead of <txp:zem_contact_text type="email" /> (unless we can reliably trap that case too). From memory, I think the plugin fails to send if there isn’t an email field.

So currently:

  • Visitor fills out a ZCR form which asks for an email address.
  • They type an address that ends in yahoo.com or (as I and phiw13 have witnessed) gmail.com, or <insert name of provider who will cause problems in the future>.
  • They send the form off and it disappears into the abyss because the recipient server thought it didn’t originate from the domain from which it was sent.

In which case, yes, phiw13’s solution seems the logical route. No special cases. Use the sender’s email as Reply-to:, and make the From: header the contact address unless from or from_form attributes are set.

I’ll look into doing that unless someone can see an overarching reason why it wouldn’t work.


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

#198 2017-05-01 02:02:39

mericson
Member
Registered: 2004-05-24
Posts: 137
Website

Re: zem_contact_reborn v4.5.0.0: contact mail form processing

I continuously get the error message “The form has expired, please try again.” for the contact form on a site I’m supporting. I’ve also received complaints from others that it doesn’t work.

Just to try it I upgraded my zem_contact_reborn and zem_contact_lang to the most recent versions.

FYI, running…
Textpattern version: 4.6.2
PHP version: 5.6.30
zem_contact_reborn 4.0.3.21
zem_contact_lang 4.0.3.6

Offline

#199 2017-05-01 02:47:51

phiw13
Plugin Author
From: South-Western Japan
Registered: 2004-02-27
Posts: 3,637
Website

Re: zem_contact_reborn v4.5.0.0: contact mail form processing

mericson wrote #305571:

I continuously get the error message “The form has expired, please try again.” for the contact form on a site I’m supporting. I’ve also received complaints from others that it doesn’t work.

Just to try it I upgraded my zem_contact_reborn and zem_contact_lang to the most recent versions.

FYI, running…
Textpattern version: 4.6.2
PHP version: 5.6.30
zem_contact_reborn 4.0.3.21
zem_contact_lang 4.0.3.6

You are running an older version; try version 4.5.0.0 (and you don’t need zem_contact_lang with that version).


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
phiw13 on Codeberg

Offline

#200 2017-05-11 07:02:19

Kjeld
Member
From: Tokyo, Japan
Registered: 2005-02-05
Posts: 465
Website

Re: zem_contact_reborn v4.5.0.0: contact mail form processing

Kjeld wrote #304168:

I just installed zem_contact_reborn v4.5.0.0 on a site using MLP.

The English side works well, but on the Japanese side, I get messages like zem_contact_email_thanks instead of the actual Japanese language strings.

What am I missing?

Bump… Posted this in February, but got no responses yet.

You can see the issue here. It says zem_contact_contact instead of the actual Japanese language string…

Last edited by Kjeld (2017-05-11 07:17:13)


Old Photos of Japan – Japan in the 1850s~1960s (100% txp)
MeijiShowa – Stock photos of Japan in the 1850s~1960s (100% txp)
JapaneseStreets.com – Japanese street fashion (mostly txp)

Offline

#201 2017-05-11 07:09:49

phiw13
Plugin Author
From: South-Western Japan
Registered: 2004-02-27
Posts: 3,637
Website

Re: zem_contact_reborn v4.5.0.0: contact mail form processing

Kjeld wrote #305660:

Bump… Posted this in February, but got no responses yet.

Did you miss this post ?

(IOW there are no Japanese language strings available)


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
phiw13 on Codeberg

Offline

#202 2017-05-11 09:29:24

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,443
Website GitHub

Re: zem_contact_reborn v4.5.0.0: contact mail form processing

Kjeld wrote #305660:

It says zem_contact_contact instead of the actual Japanese language string…

Sorry for missing your request. Have you added Japanese strings to the plugin? Are they in your database if you, for example, query it:

select * from txp_lang where name like 'zem_contact%' and lang = 'ja-jp'

Edit: phiw13 was faster!

Last edited by Bloke (2017-05-11 09:40: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

#203 2017-06-22 13:42:30

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,316

Re: zem_contact_reborn v4.5.0.0: contact mail form processing

How can I add a zemerror class to the body tag? In case it can’t be done with zcr: Could it be achieved with adi_gps, i.e. is the random code “predictable” in any way so it could be used in adi_gps?

(Background info: I’ve some CSS animations on the page that I want to overrule cause they seem to avoid the page from skipping right to the zem_error section. Plus the contact form is in the middle of the page, amidst several other articles, i.e. if I stretch the form to elements at the beginning of the page, some things might stop validating or even working.)


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#204 2017-06-23 10:59:17

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,443
Website GitHub

Re: zem_contact_reborn v4.5.0.0: contact mail form processing

uli wrote #306056:

How can I add a zemerror class to the body tag?

You might have some luck with the zemcontact.render callback. It’s called when the form is displayed to allow you to change it, but you might be able to check the status of the global $zem_contact_error in that callback and take action on other elements there?

You don’t have direct access to the DOM, but you might be able to manipulate the buffer, or (perhaps better) just drop some JavasSript on the page right there in the ZCR form that adds the class onload if there’s anything in the $zem_contact_error variable.

There’s nothing in the URL that could help you determine what the error state is.


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

#205 2017-06-23 14:07:26

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

Re: zem_contact_reborn v4.5.0.0: contact mail form processing

Is there a way to have a pull down menu with different recipients using the zcr?

At the moment all I see is

<txp:zem_contact to="recipient@example.com">

… unless of course I am missing something!


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

Offline

#206 2017-06-23 14:22:51

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,316

Re: zem_contact_reborn v4.5.0.0: contact mail form processing

Bloke wrote #306064:

[…]if there’s anything in the $zem_contact_error variable. […]

So I put <txp:variable name="zem_contact_error" /> for testing on the page, inside the body class, to see what’s in there on an error, but there’s nothing new there. Am I doing it wrong?


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#207 2017-06-23 14:27:21

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,316

Re: zem_contact_reborn v4.5.0.0: contact mail form processing

Yiannis, the section “User selectable recipient, without showing email address” from the plugin help might be what you’re after.


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#208 2017-06-23 15:05:33

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

Re: zem_contact_reborn v4.5.0.0: contact mail form processing

Hi Uli,

Thanks so much! that was 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

#209 2017-06-23 15:42:22

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,316

Re: zem_contact_reborn v4.5.0.0: contact mail form processing

uli wrote #306066:

So I put <txp:variable name="zem_contact_error" /> for testing on the page

OK, I see that was certainly not what you meant, Stef, but tracing errors in the console window didn’t give a hint either …


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#210 2017-06-23 15:56:12

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,443
Website GitHub

Re: zem_contact_reborn v4.5.0.0: contact mail form processing

uli wrote #306066:

So I put <txp:variable name="zem_contact_error" /> for testing on the page

Ah, no. You’ll only be able to get to the variable from PHP. Try making a new public-side plugin from Plugin Composer and enable it:

register_callback('uli_zcr_bodyclass', 'zemcontact.render');

function uli_zcr_bodyclass($evt, $stp, $data, $atts)
{
    global $zem_contact_error;
    dmp($zem_contact_error); // Just to see what it contains

    if ($zem_contact_error) {
        echo script_js(<<<EOJS
jQuery(function() {
    jQuery('body').addClass('zemerror');
});
EOJS;
        );
    }
}

Untested, but something like that might work.


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

Board footer

Powered by FluxBB