Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1333 2013-10-04 20:22:13

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: zem_contact_reborn 4.0.3.20

Add this below the second if:

echo mysql_errno() . ": " . mysql_error() . "\n";

That should hopefully dump an error message on your screen when submitting the form.

Offline

#1334 2013-10-08 20:43:38

draganbabic
Member
From: Novi Sad, Serbia
Registered: 2006-09-27
Posts: 118
Website

Re: zem_contact_reborn 4.0.3.20

Been using the fantastic zem_contact_reborn plugin for various needs, and it always got me through. However, I have a really special situation that I would love to be able to solve with ZCR, even if it means I need to hack the core.

So, I have a form that users fill out, no biggie. However, I have a checkbox that if checked, the form should send the email to a specific recipient (a special email address).

So I basically need to send three emails:

  1. One for the person that submitted the form
  2. One to the original recipient of the form
  3. One to a specific email address, only if a checkbox has been checked

I would really appreciate any help on this matter, whatsoever.

Cheers!

Offline

#1335 2013-10-09 16:29:54

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: zem_contact_reborn 4.0.3.20

Dragan, you can do that with a to_form attribute:

<txp:zem_contact to_form="my_zem_contact_to_form">
...
</zem_contact>

Where the “my_zem_contact_to_form” form contains something like:

<txp:php>
  global $zem_contact_form;
  $to = 'original@recipient.org';
  if ($zem_contact_form['label of the checkbox'] == "Yes"]
  {
    $to .= ',checked@recipient.org'
  }
  echo $to;
</txp:php>

However, this sends the emails #2 and #3 as a single email with 2 recipients. If you really want a separate #3 email so #2 doesn’t see #3 gets the email as well, then it can only be done by editing the plugin code.

Offline

#1336 2013-10-10 13:08:03

draganbabic
Member
From: Novi Sad, Serbia
Registered: 2006-09-27
Posts: 118
Website

Re: zem_contact_reborn 4.0.3.20

Will give this a try, Ruud.

Thanks!

Offline

#1337 2013-10-23 13:35:56

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,137
GitHub

Re: zem_contact_reborn 4.0.3.20

A quick bump on this (huge) thread to say that I’ve finally managed to blend zem_contact_reborn functionality with Twitter Bootstrap styling using rah_replace. Rather than custom style the zem* classes, I applied existing CSS classes to each element of the form with a bit of extra inline styling to make the spacing my own spec.

Sanitised code follows:

<txp:zem_contact label="" redirect="/contact-sent" to="me@example.com">
	<txp:zem_contact_serverinfo name="REMOTE_ADDR" label="IP" />
	<txp:zem_contact_serverinfo name="HTTP_USER_AGENT" label="Browser" />
	<txp:rah_replace from='<input type="text" id="name" class="zemText "' to='<input type="text" id="name" class="form-control"'><txp:zem_contact_text label="Name" name="name" required="no" /></txp:rah_replace>
	<txp:rah_replace delimiter='|' from='<input type="text" id="email" class="zemText "|<label for="email"' to='<input type="text" id="Email" class="form-control"|<label for="email" style="margin-top:5px;"'><txp:zem_contact_email label="Email" name="email" required="no" /></txp:rah_replace>
	<txp:rah_replace delimiter='|' from='<textarea id="message" class="zemTextarea "|<label for="message"' to='<textarea id="message" class="form-control "|<label for="message" style="margin-top:5px;"'><txp:zem_contact_textarea cols="40" label="Message" name="message" rows="10" required="no" /></txp:rah_replace>
	<txp:rah_replace from='<input type="submit" class="zemSubmit"' to='<input type="submit" class="btn btn-default" style="margin-top:5px;"'><txp:zem_contact_submit label="Send" /></txp:rah_replace>
</txp:zem_contact>

The end result is the contact form here if you’re curious what it looks like.

Offline

#1338 2013-11-08 14:55:47

Orange
New Member
Registered: 2013-11-08
Posts: 4

Re: zem_contact_reborn 4.0.3.20

Problem: Zem Contact Reborn – copysender fails

Hello all,

I have used Zem Contact Reborn on my website, the simplified code looks like this:

<txp:zem_contact to="office@email.com" copysender="1" subject="Quote Request from" from="sales@email.com">
          <p><strong>First Name:</strong>
          <txp:zem_contact_text label="First Name" /></p>
          <p><strong>Last Name:</strong>
          <txp:zem_contact_text label="Last Name" /></p>
          <p><strong>Business Name:</strong>
          <txp:zem_contact_text label="Business Name" /></p>
          <p><strong>Email Address:</strong>
          <txp:zem_contact_text label="Email Address" /></p>
          <txp:zem_contact_submit label="Send" />
</txp:zem_contact>

I have recently added the copysender=“1 part to the zem_contact tag, however no one is receiving a copy of the email after completing the form. I have tried with multiple addresses but to no avail. I receive no errors.

Any help would be greatly appreciated as I’ve been on this issue for a few hours now :(

Orange.

Offline

#1339 2013-11-09 12:24:07

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: zem_contact_reborn 4.0.3.20

Orange, for the emailaddress, use <txp:zem_contact_email /> instead of <txp:zem_contact_text />

Offline

#1340 2013-11-11 09:39:22

Orange
New Member
Registered: 2013-11-08
Posts: 4

Re: zem_contact_reborn 4.0.3.20

ruud, thank you so much. I can’t believe I overlooked that. Thanks again!

Offline

#1341 2013-11-12 16:17:10

brunodario
Member
From: Belo Horizonte, Brasil
Registered: 2007-09-19
Posts: 75

Re: zem_contact_reborn 4.0.3.20

I’ve recently had to change all forms on a website due to anti-spoofing rules. I had to add the “from” field to match an email from the same domain.

Is there a way to keep the “from” email but to include the sender email on a “reply-to:” header?

I see this as a bug since the plugin help says:

_from=“email address”
Email address used in the “From:” field when sending email. Defaults to the sender’s email address. If specified, the sender’s email address will be placed in the “Reply-To:” field instead._

But the sender email is not being added in the “Reply-To:”

Offline

#1342 2013-11-12 16:54:04

brunodario
Member
From: Belo Horizonte, Brasil
Registered: 2007-09-19
Posts: 75

Re: zem_contact_reborn 4.0.3.20

Also, a very tiny contribution :-) :

If you’re using a select field with this plugin, such as:

<txp:zem_contact_select label="Your label" list=",Option1, Option2, ..." />

it will use the depreciated “split” function. Update the plugin to use the “explode” function instead, find the following code (line 538):

$list = array_map('trim', split($delimiter, preg_replace('/[\r\n\t\s]+/', ' ',$list)));

replace with:

$list = array_map('trim', explode($delimiter, preg_replace('/[\r\n\t\s]+/', ' ',$list)));

And everything is good again.

Offline

#1343 2013-11-12 17:02:52

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: zem_contact_reborn 4.0.3.20

brunodario wrote:

Is there a way to keep the “from” email but to include the sender email on a “reply-to:” header?
I see this as a bug since the plugin help says: […]
But the sender email is not being added in the “Reply-To:”

Are you using a <txp:zem_contact_email /> tag in that form? That’s required to make this work.

Offline

#1344 2013-11-12 19:19:49

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

Re: zem_contact_reborn 4.0.3.20

Hey everyone. Just while brunodario mentioned it and it’s fresh in my mind, I have a modified version of this plugin which I had to put together for my own use one day. It contains the following changes:

  • Most of the useful HTML 5 attributes added to relevant tags: placeholder, autofocus, autocomplete, type, and pattern.
  • The email field uses type="email" as default.
  • The max / min attributes have been re-purposed to additionally drop the values into the tags if the doctype supports them, which means browsers can do some client side validation if they support it or offer specialised widgets like range sliders (step has been added to help with this too). The max / min atts are also validated server side for any ‘numeric’ field types and an error thrown if they’re out of bounds.
  • CSS class attribute allows overriding built-in class names.
  • Textpack replaces zem_contact_lang plugin.
  • explode() replaces deprecated split() function.

I’ve had it running on a few sites for a while now and it’s holding up well. Would it be OK if I mailed it to you, ruud, so you could review it and see if it’s something you might consider releasing as an updated version? Or to fix it up into a releasable state if you think the changes need taming? Ta.


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

Board footer

Powered by FluxBB