Forums

Has anybody built a contact form that works with SPF?

fribse 27 Sep, 2011
As some hosts has SPF blocking implemented, I'm getting into problems when using the Joomla Contact form, so I want to use ChronoForms for this as well.
The problem with J Contact form is that when it sends an email from a user with email: [email]user@domain1.com[/email] though my host at domain2.com, the email is sent from domain2.com with [email]user@domain1.com[/email] as the from address.
I would very much like that the mail that is sent out, has the Joomla standard mailaddress set as the from address, and the [email]user@domain1.com[/email] as the 'reply-to' instead.

So I was wondering if anybody has already created a chronoforms for that, or if I should venture in to the unknown :-D
fribse 28 Sep, 2011
Hi

My form is well under way, so far three problems.
1) I can't make recaptcha show up (I did change the public code). I have placed a 'Load Recaptcha' at 'on load', and a 'Check Recaptcha' at the 'on submit'
2) the Reply-To field generated by the form is wrong:

Reply-To: SENDERNAME <no-reply@SENDER.DOM>,
	Submitter name <submitter@email.com>


The reply to field should only contain the Submitter name <submitter@email.com> (the SENDERNAME is the one setup as the from field)

3)How do I start the form with different email addresses? How do I create a menu item, which calls the form with a receipient email? Or should I instead just use the select element, and create matching values there?
fribse 28 Sep, 2011
Ok, got 3) solved, I used the selector to choose which contact to send to. Works nicely, and it removes some clutter from the menu.

Now I got a new item

4) Copy-to-self. I've created a checkbox for this, but I can't find an action that checks the value of that, and then activates one or another mail action? Do I need to fiddle with custom-code?
fribse 28 Sep, 2011
1) is not solved, but I've given up on recaptcha, and I'm just using core captcha now.
GreyHead 28 Sep, 2011
Hi fribse,

1) For the ReCaptchs it looks as though you are missing the {ReCaptcha} in the Form HTML. Adding a Custom element with {ReCaptcha} in the code box should do the trick.

3) There have been some odd bugs in Joomla! and possibly ChronoForms) around Reply To names - there's a thread here from a week or two back. I think that there is now a fix.

4) You either need Custom Code (I think we've answered this in the forums). Or My Custom Email [GH} action (from [url=http://greyhead.net/how-to-docs/chronoforms-v4-actions]here[/url] ) has a Condition box that will allow you to make the email conditional on the CheckBox value.

To make the sending the email conditional on the form data add an input name in curly brackets, a double colon ::, and a value to be matched e.g. {send_email}::1



Bob
fribse 28 Sep, 2011

1) For the ReCaptcha it looks as though you are missing the {ReCaptcha} in the Form HTML. Adding a Custom element with {ReCaptcha} in the code box should do the trick.



Ahh, absolutely right, that made it work :-)

3) There have been some odd bugs in Joomla! and possibly ChronoForms) around Reply To names - there's a thread here from a week or two back. I think that there is now a fix.



I found the thread you refer to, but that doesn't solve it. As the thread says, it's solved in Joomla, but not in CF. The mail address that is used as the from address, is a real address, so that's not the problem, the problem is that the reply-to field contains two addresses, where it should only contain 1. According to the bugregport it's fixed in Joomla SVN, but it's not really clear if the fix made it to 1.7.1.

4) You either need Custom Code (I think we've answered this in the forums). Or My Custom Email [GH} action (from [url=http://greyhead.net/how-to-docs/chronoforms-v4-actions]here[/url] ) has a Condition box that will allow you to make the email conditional on the CheckBox value.

To make the sending the email conditional on the form data add an input name in curly brackets, a double colon ::, and a value to be matched e.g. {send_email}::1



Ahh, I'll look into that.

Thanks!
fribse 30 Sep, 2011
Regarding 4) How do I go about getting your custom action imported to CF4?
GreyHead 30 Sep, 2011
Hi fribse,

Unzip the download, there should be a folder in it called email_gh with three files in the folder. It you can copy the folder into administrator/components/com_chronoforms/form_actions/

Or you can create a new folder at administrator/components/com_chronoforms/form_actions/email_gh and copy the files into is. (Some Mac users seem to have problems with folders in zip files.)

You an use any FTP programme to upload the folder and/or files to your site.

Bob
fribse 30 Sep, 2011
Hi Bob

Ok, got it uploaded, but alas I cannot use it, it only has the static fields from the email, and not the dynamics that I use.
How come that there is not a 'condition' action in the action fields at all???
That seems like a very simple thing to implement (not for me though 😀 ).
GreyHead 30 Sep, 2011
Hi fribse,

Please check the Help Tab.

The Email Setup tab

[list]

  • The Dynamic and Static tabs have been merged into an Email Setup tab.

  • The boxes on the Email Setup tab will accept either a string e.g. [email]user@example.com[/email] or an input name in curly brackets {input_text_1}. This lets you mix and match static and dynamic values.

  • The one special case is the From Email box which will only accept a valid email address. Using a dynamic From Email address is the most frequent cause of failed emails. Use a dynamic Reply To Name and Reply To Email to make it easy to reply to the form submitter.

  • The To, CC and BCC boxes will take a comma separated list of email addresses; you can mix and match static and dynamic addresses e.g. [email]info@example.com[/email], {email}, [email]admin@mydomain.com[/email]

  • The Subject, From Name and Reply To Name boxes take a text string which may include form inputs in curly brackets e.g. Message from {name}

  • Only the To email input is required. Default values will be set for other boxes.
  • [/list]


    Bob

    PS I don't support the Dynamic From Email because it is the biggest cause of email problems.
    fribse 01 Oct, 2011
    Ahhaaa, got it, sorry, but I'm a bit unsure on what a checkmark gives of values?
    I've tried using {selvmail}::1 and {selvmail}::0 without a good result.
    What should I test for?
    fribse 02 Oct, 2011
    Ok, I think I'm close to this, but it still avoids me.
    I have created the form, almost as I like it, it respects the SPF by using 'reply-to' fields etc.
    I do the session check, and the recaptcha works perfectly.
    The only small part is the copy-to-self checkmark, I've searched the forum, and haven't really found the solution, there are a lot of setups, some for V3, and also suggestions about the ghost function, but no matter what I've tried it doesn't work.
    In the hope that some of you gurus can give me the final piece, I've posted the backup below.
    [attachment=0]contactform.zip[/attachment]
    There is of course still the bug with the double 'reply-to', but I can live with that.
    GreyHead 02 Oct, 2011
    Hi frobse,

    Add a DeBugger action temporarily to the OnSubmit event to see what value is being output.

    You may need to remove any [] from the Checkbox name if it started out as a Checkbox group as the returned result will be an array rather than a string.

    You may also need to enable the Ghost options to make sure that a value is returned (without this an unchecked checkbox returns nothing) though I don't think that this is necessary,.

    Bob
    fribse 02 Oct, 2011
    Excellent, got it, nice tool.

    Ok, if I set the Field Default Value to 1 for the checkmark, the value will be 1 if it's set, and 0 if it's not.
    But I get an error when I set the check mark: "Language string failed to load: invalid_addres", I've searched the forum, but I'm a bit confused of the results. I don't get an error with the normal email form, only when the value is true, and the Email GH action is used.

    I'm also a bit confused about the meaning of 'default' value, and ghost value, but it's fine this way, and it's working :-).
    I've created a simple contact form that does the job much better than the standard one.

    One thing, the dropdown list I've defined, is made with 'label:value', and the value is then used as the receipient address.
    Is there a way to show the label selected in the email template? It would be nice I guess for the sender to know to whome he sent the message.
    GreyHead 05 Oct, 2011
    Hi fribse,

    The language string error seems to be linked to a Joomla! bug. I'm not clear if there is also a ChronoForms bug that csues this too. The main fix seems to be to make sure that in your Joomla! site configuration the From Email address domain matches the site domain.

    For the label:value problam I'm not completely sure what you want. Usually the easiest solution is to look up the missing data again after the form is submitted. Or you can use a script to copy the missing part into a hidden input when the select box changes.

    Bob
    fribse 11 Oct, 2011

    The language string error seems to be linked to a Joomla! bug. I'm not clear if there is also a ChronoForms bug that csues this too. The main fix seems to be to make sure that in your Joomla! site configuration the From Email address domain matches the site domain.


    Ok, for now, I'll live with it, it seems to work, even though the error is shown. I've set up the mailaddresses correctly to match the domain, and the mailaddress is working, so, that part is ok.

    For the label:value problam I'm not completely sure what you want. Usually the easiest solution is to look up the missing data again after the form is submitted. Or you can use a script to copy the missing part into a hidden input when the select box changes.



    Well, the dropdown box in the form is like this:
    Formand:formand@dkdb.dk
    Kasserer:kasserer@dkdb.dk
    Webmaster:webmaster@dkdb.dk

    When one of these are selected, the value is used in the mail address, so I only have one form, for several receipients.

    What I think would be nice is the mail I send to the user using the contact form I could write:
    "You've sent a mail to Formand" or something like that.
    I don't want to write:
    "You've sent a mail to [email]formand@dkdb.dk[/email]" because I don't want to reveal the addresses.
    Currently it just says "You've sent a mail" :-)
    This topic is locked and no more replies can be posted.