Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1111 2011-10-18 22:21:53
- dreamer
- Member
- Registered: 2007-06-08
- Posts: 242
Re: zem_contact_reborn 4.0.3.20
I can’t send the form through. I get this message;
Sorry, unable to send email.
Apparently, it will go through because the email it is to be sent to is using the same domain the site is hosted on. But if I use an email address seperate from the domain (ie; gmail, or yahoo), then it works.
Anyway to remedy this issue?
Offline
#1112 2011-10-20 09:39:46
Re: zem_contact_reborn 4.0.3.20
^^ check mail server logs for errors.
Offline
#1113 2011-11-23 11:15:33
Re: zem_contact_reborn 4.0.3.20
Trying to send a form, after displaying errors, send button search for favicon.ico like this:
http://www.domain.it/section/favicon.ico#zcrf13d4e0e75c9480f2d1855840b5c4820
I’ve got the same behaviour with the full url to the article.
I’m using MLP and Textpattern 4.4.1
How can I solve it?
Offline
#1114 2011-11-24 18:34:08
Re: zem_contact_reborn 4.0.3.20
I’m not sure how favicon.ico got in there, but I’m pretty sure ZCR doesn’t do that. If the favicon.ico is somehow references elsewhere in your template, you may want to ask in the MLP topic.
Offline
#1115 2011-12-01 23:01:37
Re: zem_contact_reborn 4.0.3.20
I have modified zem_contact_reborn to do a few of things:
- added some attributes to the fields to either show or not show the label. This is intended to allow you a little bit more control over how the email appears,
- added some attributes to the fields to either show or not show the field contents. This is mainly to prevent the subject field appearing both in the subject line of the email and in the body,
- added
bccandbcc_formattributes to allow you to send emails to number of people without disclosing the addresses of all of the recipients. This functionality overrides anytoorto_formattributes ie. you have to choose whether you want atoor abcc.
For testing purposes, I have created email accounts at Hotmail and Yahoo. I notice that the messages sent to the Hotmail account are flagged as junk immediately (until I identify them as not junk – after that everything works fine); Yahoo seems to be happier.
Are there any tips I need to take into account in terms of forming the headers to ensure that, as much as possible, these emails are not flagged as junk/spam/etc? I’m no programmer, so I would be grateful for any tips or ideas.
Once I have incorporated any ideas, I will release this for anyone interested to have a play with and tell me where I have gone wrong. It’s my first real attempt to work on a plug-in (of course, it’s easier to stand on the shoulder of giants that start from a blank page).
Future intentions are to develop an email template with replacement tags (like Bloke uses) so that there is more capacity yet again to customise the emails.
Offline
#1116 2011-12-01 23:20:20
Re: zem_contact_reborn 4.0.3.20
Are there any tips I need to take into account in terms of forming the headers to ensure that, as much as possible, these emails are not flagged as junk/spam/etc? I’m no programmer, so I would be grateful for any tips or ideas.
Check the headers in the received email. Usually, there is link/option to “show original format. There may be some clues there on why it was flagged as junk. Maybe something related to SPF records. Let’s start there :)
Offline
#1117 2011-12-02 07:22:03
Re: zem_contact_reborn 4.0.3.20
Future intentions are to develop an email template with replacement tags (like Bloke uses) so that there is more capacity yet again to customise the emails
I briefly discussed something similar a while back with Ruud when I also made some changes to zcr and passed them back to him. He had several detailed ideas of his own on this, and on my own changes – all good I hasten to add – but I don’t know how far he is with that yet.
TXP Builders – finely-crafted code, design and txp
Offline
#1118 2011-12-02 11:09:41
Re: zem_contact_reborn 4.0.3.20
Well, this was mainly for my own needs – if someone else is working on a neater solution than I’m happy to stand aside for the experts.
But I do want to get the bcc to function as best as possible – it is my technique to send out bulk emails to members (and our membership is quite small, only 40 or so) – and ensuring the get the emails the first time, every time is important as these are less tech-savvy than most. From looking around the web, it looks like I need to look more closely at the headers set – I think ZCR doesn’t set the full range of possibilities, and it seems that email clients and web mail target incomplete headers as an indicator for spam.
I still intend to let others have a look and play with my modifications when I’m done.
Offline
#1119 2011-12-18 16:02:15
Re: zem_contact_reborn 4.0.3.20
Hi,
I want to use the to_form feature and output a dynamic list of addresses.
Now I will like to get help with the syntax please:
<txp:php>
global $zem_contact_form;
switch($zem_contact_form['my-select-list-label'])
{
</txp:php>
<txp:article_custom section="my-section-name" limit="999" sort="Posted desc">
case '<txp:custom_field name="City" />': echo '<txp:custom_field name="Email_address" />';
break;
</txp:article_custom>
default: echo 'info@example.com';
<txp:php>
}
</txp:php>
Now I know that this is not the right syntax, but I don’t know what is please?
Offline
#1120 2011-12-18 21:34:26
Re: zem_contact_reborn 4.0.3.20
THE BLUE DRAGON wrote:
Hi,
I want to use the to_form feature and output a dynamic list of addresses.
Now I will like to get help with the syntax please:
Something like this, where custom_1 is the custom field (not how you’ve labeled it!) that contains the email address and custom_2 is the custom field that contains the city.
<txp:php>
global $zem_contact_form;
$email = safe_field('custom_1', 'textpattern', "custom_2 = '".doSlash($zem_contact_form['my-select-list-label'])."'");
if ($email === FALSE) $email = 'info@example.com';
echo htmlspecialchars($email);
</txp:php>
Offline
#1121 2011-12-18 21:57:25
Re: zem_contact_reborn 4.0.3.20
Or based on Ruud’s snippet, same with the help of a article_custom;
<txp:article_custom sort="custom_1 asc" limit="1" City='<txp:php> echo $GLOBALS["zem_contact_form"]["my-select-list-label"]; </txp:php>'>
<txp:custom_field name="Email_address" default="info@example.com" />
</txp:article_custom>
Note that both, mine and Ruud’s will only return a single email address, not a list. If your idea is to return multiple addresses from multiple articles selected based on the city, and only show info@example.com as a fallback when no articles are found, you will need something bit different. Something like following:
<!--
has_email named variable will be set "1" in the article's container,
if addresses are found. For now we set it as "0".
-->
<txp:variable name="has_email" value="0" />
<!--
List articles that have "Email_address" populated
and "City" matched form's selection
-->
<txp:article_custom sort="custom_1 asc" Email_address="_%" limit="999" City='<txp:php> echo $GLOBALS["zem_contact_form"]["my-select-list-label"]; </txp:php>'>
<txp:if_different>
<txp:custom_field name="Email_address" default="info@example.com" />
</txp:if_different>
<txp:variable name="has_email" value="1" />
</txp:article_custom>
<!--
Show fallback if no addresses were found.
-->
<txp:if_variable name="has_email" value="0">
info@example.com
</txp:if_variable>
Please keep in mind that Textpattern doesn’t escape LIKE operators’ wildcard syntax in the custom fields’ SQL statements. If a value passed to article_custom’s custom_field attribute (custom_field="value") contains any wildcard characters (_, %), those will be treated as one and not as plain text. If any of the fields used to filter the list contains (or are populated with) any of those wildcard characters, you may get unexpected results say the least.
Last edited by Gocom (2011-12-18 22:18:02)
Offline
#1122 2011-12-19 11:12:43
Re: zem_contact_reborn 4.0.3.20
Thanks Ruud and Gocom, I used Jukka second code to return multiple addresses (one from each article).
It works great, thank you very much! :)
And ohh…I wasn’t even close with the plugin help example :/
The idea was that I got a ‘showrooms’ section and a ‘contact’ page,
and in each showroom article the client enter it’s email address.
Now when a visitor choose a showroom from the select-list in the contact page form,
it will send the email to the address that the client set in that showroom’s article.
So now it’s all dynamic, I present the list of showrooms in the contact form using article-custom and now thanks to your code I set the to_form feature to be also dynamic with article-custom, so in the end the client can update showrooms and it all be done automatically.
(Besides of the default email address which is static)
Cool :)
Offline
#1123 2012-01-16 20:08:33
- ajw-art
- Member
- Registered: 2010-02-10
- Posts: 33
Re: zem_contact_reborn 4.0.3.20
I’m using ZCR to generate the contact me form on my webpage. It’s working as expected with one exception: the select field. To be specific, it’s the only field that doesn’t come through in the email that the form sends to me. Any ideas as to why this might be the case?
I did make some changes to the plugin code itself to enable support for the HTML5 placeholder attribute, but I can’t see where anything I’ve done would have disabled the select field. Here’s a link to the edited code on pastebin so you can see the changes I made. Any help would be much appreciated. Thanks!
Offline
#1124 2012-01-16 21:31:09
Re: zem_contact_reborn 4.0.3.20
@ajw-art, it’s probably related to the “name” attribute value, which contains a space. Try replacing it with something without a space. This would’ve caused the same problem if you were using an unmodified ZCR ;)
Offline
#1125 2012-01-16 21:40:24
- ajw-art
- Member
- Registered: 2010-02-10
- Posts: 33
Re: zem_contact_reborn 4.0.3.20
@ruud Yup, that was it! Thanks a lot.
Offline