Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#37 2006-12-13 04:32:22

hcgtv
Plugin Author
From: Key Largo, Florida
Registered: 2005-11-29
Posts: 2,722
Website

Re: Plugin: zem_contact_reborn 4.0.3.18 (old version)

maniqui wrote:

Personally, from time to time, I have problems with the e-mails sent using ZCR: e-mails never arrives to my account.

I think in the fight against spam, our well intentioned scripts are getting ignored somewhere in the smtp stream.

One option would be to go back to the old way of doing things, write out the message to a local text file as a backup record. The plugin could have an option to open up this backup file in a text area where we could manage it.

Offline

#38 2006-12-13 10:40:56

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

Re: Plugin: zem_contact_reborn 4.0.3.18 (old version)

There’s no need to add this as a feature to ZCR, because it can be done as a separate plugin that uses a ZCR callback event.

For a website that gets a lot of news items through ZCR, I’ve written a plugin which adds all submissions to a TODO list (a tab on the TXP admin side) where I/we can edit the submission and assign in to various authors (who can even claim the item themselves, if they want).

BTW, if there are specific things, in the emails that ZCR sends, that anti-spam tools are picking up as spam, then I’d love to hear about it, because chances are that it can be fixed.

Last edited by ruud (2006-12-13 10:43:58)

Offline

#39 2006-12-15 01:05:47

jrphelps
Member
From: Fort Worth, TX
Registered: 2006-07-13
Posts: 30

Re: Plugin: zem_contact_reborn 4.0.3.18 (old version)

ruud wrote:

  • The ‘to_form’ is now parsed after the main ‘form’ (containing all the input field tags), allowing you to let the ‘to_form’ return an email address based something entered by a visitor.

Can someone go into a little more depth on how to use the to_form parameter? What I would like to do is have a contact form with a select widget where the user selects the category of their contact and that selection determines what email address it goes to. Is this how the to_form is supposed to work? If so, it would be really great is someone could school me on how to achieve what I’m after.

Offline

#40 2006-12-15 12:12:12

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

Re: Plugin: zem_contact_reborn 4.0.3.18 (old version)

Assuming that you have a zem_contact_select labeled ‘Department’ with the options ‘Support’, ‘Accounting’, ‘Sales’:

<txp:zem_contact_select label="Department" list=",Support,Accounting,Sales" required="yes" />

You could use a to_form like this (not tested, but apart from typing errors it should work):

<txp:php>
global $zem_contact_form;
switch($zem_contact_form['Department']) {
  case 'Support': echo 'crew@example.com'; break;
  case 'Accounting': echo 'dungeon@example.com'; break;
  case 'Sales': echo 'showmethemoney@example.com'; break;
  default: echo 'someone@example.com';
}
</txp:php>

The default email address is to ensure that the form always returns an email address, no matter what happens (in case you forget to add the required attribute or there is a mismatch between the form and the list of options in the select tag.

Last edited by ruud (2006-12-15 12:14:51)

Offline

#41 2006-12-15 14:22:50

jrphelps
Member
From: Fort Worth, TX
Registered: 2006-07-13
Posts: 30

Re: Plugin: zem_contact_reborn 4.0.3.18 (old version)

ruud, thanks for that. I think I can manage that!

Offline

#42 2006-12-21 22:10:00

jstubbs
Moderator
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: Plugin: zem_contact_reborn 4.0.3.18 (old version)

Ruud,

Possible bug: If a drop down list item does not have:

1. required element defined (required=yes by default, as I understand it)
2. no forcing the user to choose an option like so: “,yes,no”

Then an error message does not display if the list item is not selected, as it should be, because by default it is required.

Once I change the list item to something like this: list=”,Yes,No” – then the error message displays.

FYI!

Offline

#43 2006-12-21 22:38:03

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

Re: Plugin: zem_contact_reborn 4.0.3.18 (old version)

Do you mean that if you set list="yes,no" you don’t get an error even if you haven’t explicitly selected an option? If so, that’s normal, because without an empty option, there’s always a valid option selected (usually the first, unless your override it with the selected attribute), so it can’t trigger an error.

Last edited by ruud (2006-12-21 22:38:55)

Offline

#44 2006-12-21 23:27:50

jstubbs
Moderator
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: Plugin: zem_contact_reborn 4.0.3.18 (old version)

Yes, forget my last post, I should have thought it through before posting. Its not an error if something is selected :-)

Offline

#45 2006-12-27 15:47:11

Zarabadoo
Member
From: Denver, CO
Registered: 2004-03-14
Posts: 28
Website

Re: Plugin: zem_contact_reborn 4.0.3.18 (old version)

I am assuming the subject_form is supposed to work the same way as the to_form, but I am not getting the results I am expecting. In a nutshell, I want people to be able to use an input box to give us a custom subject line prepended with a tag to designate what site it came from in the email’s subject field. Here is what I have so far:

<txp:zem_contact to="email@address.org" form="2007_email" subject_form="2007_email_subject" label="" />

the 2007_email form is as follows:

<txp:zem_contact_text label="Name" break=": " /><br />
<txp:zem_contact_email label="Email" break=": " /><br />
<txp:zem_contact_text label="Subject" break=": " /><br />
<txp:zem_contact_textarea cols="35" rows"10" label="Message" break=": " /><br />
<txp:zem_contact_submit label="Send message" />

and finally the 2007_email_subject form:

<txp:php>
global $zem_contact_form;
echo "NDK Inquiry - $zem_contact_form['Subject']";
</txp:php>

It is probably something very simple. I am not much of a PHP pro, but I have learned to be able to pick at it a bit. Any insight is appreciated.


—Al “Zarabadoo” Steffen
http://www.zarabadoo.com

Offline

#46 2006-12-27 17:29:57

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

Re: Plugin: zem_contact_reborn 4.0.3.18 (old version)

Note that I don’t recommend using a free-format text field to override the subject/to/from address, not without someone else auditing a code for mail header injection bugs (I don’t think there are any, but I’d rather be safe than sorry). Using a select/radio input field is less risky.

Having said that, the code you use should work… perhaps change it to:

<txp:php>
global $zem_contact_form;
echo 'NDK Inquiry - ' . $zem_contact_form['Subject'];
</txp:php>

If it doesn’t work… what is the subject of the emails that get sent?

Last edited by ruud (2006-12-27 17:36:44)

Offline

#47 2006-12-27 22:43:38

Zarabadoo
Member
From: Denver, CO
Registered: 2004-03-14
Posts: 28
Website

Re: Plugin: zem_contact_reborn 4.0.3.18 (old version)

No go. The subject is coming out as “2007_email_subject” without the quotes. So it looks like it isn’t even processing the form at all and instead taking the text I put in there literally.

As for the bugs, unfortunately something like this was requested from the convention I am doing this for. The selection box would be a mute point since each department has a separate email and as much detail as possible would be helpful. Plus the generic subject was done last year and the guest department head was subject to a letter righting campaign. with a ton of emails requesting a guest and all the emails with the same subject line. There would be far too many names and variations to put into a select list unfortunately. I am going to take full advantage of the select and radios in other types of forms though.

Last edited by Zarabadoo (2006-12-27 22:52:01)


—Al “Zarabadoo” Steffen
http://www.zarabadoo.com

Offline

#48 2006-12-28 08:11:47

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

Re: Plugin: zem_contact_reborn 4.0.3.18 (old version)

It’s a bug. You can fix it by editing the plugin and replacing this line (hit pagedown 5 times from the top to get to the place in the code where you can find that line):

$subject = parse($subject_form);

with

$subject = parse(fetch_form($subject_form));

Same applies to the $from_form. Both will be fixed in the next version.

Last edited by ruud (2006-12-28 08:12:21)

Offline

Board footer

Powered by FluxBB