PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Newbie mistake or something more

  1. Hey guys

    I have just installed Gravity Forms for the first time to use as a contact form to start with and go more advanced from there.

    I have been playing around with both a default install and its custom functions and seems to do everything I want...except send the actual contact form email entry haha.

    Form in question: http://transposedmedia.com/contact

    I have tried changing my default Wordpress email address to several different gmail and google apps emails and I don't believe it is an SMTP error as I have been able to send emails from different forms before, and I get all of the notification emails that I have setup.

    The submitted forms are showing up in my entries page and the ajax confirmation works, just not getting the emails.

    I have tried the following template tags and shortcodes but nada so far:

    <?php gravity_form(1, false, false, '', '', true); ?>

    [gravityform id=1 name=ContactForm ajax=true]

    and pasted this in my functions.php to allow the template tags:

    wp_enqueue_script("gforms_ui_datepicker", plugins_url("gravityforms/js/jquery-ui/ui.datepicker.js"), array("jquery"), "1.3.9", true);
    wp_enqueue_script("gforms_datepicker", plugins_url("gravityforms/js/datepicker.js"), array("gforms_ui_datepicker"), "1.3.9", true);
    wp_enqueue_script("gforms_conditional_logic_lib", plugins_url("gravityforms/js/conditional_logic.js"), array("gforms_ui_datepicker"), "1.3.9", true);
    wp_enqueue_style("gforms_css", plugins_url("gravityforms/css/forms.css"));

    If anyone could help me out that would be great as I am relying on this for new business opportunities.

    Andy

    Posted 13 years ago on Sunday January 30, 2011 | Permalink
  2. Jason
    Member

    Andy,

    Have you set the Notifications for the email?

    After creating each form you have the option of setting Notifications (Email routing / no email /only in Dashboard / etc)

    It is accessed by Dashboard / Forms / Edit Forms / Hover over Form Title / Notifications.

    Jason.

    Posted 13 years ago on Sunday January 30, 2011 | Permalink
  3. Ahh yeah that was it thanks Jason

    I thought the forms we set to be sent to the sites email by default

    Just one quick question for anyone out there.

    Is there anyway to choose from some different styles of the auto formatting sent with the email without touching the plugins core files?

    I want to make a lot of forms and feel the current formatting on the forms doesnt suit my business

    Thanks heaps

    Andy

    Posted 13 years ago on Sunday January 30, 2011 | Permalink
  4. The auto-formatting only applies if you use the {all_fields} token and you can't change that formatting unless you hack the core files.

    You can use the individual field tokens and create your own HTML markup/styles. You're in complete control of the look and feel of the email if you want to be. If you decide to do so, remember to check the "disable auto formatting" checkbox so line returns aren't automatically converted in < br/> tags for you.

    screenshot: http://grab.by/8FPb

    Posted 13 years ago on Sunday January 30, 2011 | Permalink
  5. frey1esm
    Member

    Hi Kevin,

    I am trying to pass along a PGP message in a form field in the admin email notification. Even though I am using individual form fields in lieu of {all_fields} in the admin notification email body, and even though I have checked the "disable Auto-formating" option, the email is still come in with field formatting (i.e. with < br /> tags after each line of the PGP message).

    What am I missing?

    Thanks!

    Posted 13 years ago on Sunday August 7, 2011 | Permalink
  6. The notification sounds like it may still be getting auto-formatted OR the emails are being auto-formatted by your mail client. Have you tested it in multiple email clients? If you disable auto formatting it isn't going to use the WordPress autop function to auto-format the text, so the breaks have to be coming from somewhere else.

    Posted 13 years ago on Monday August 8, 2011 | Permalink
  7. frey1esm
    Member

    Carl,

    It's even goofier. The ONLY parts of the notification message that are getting the < br /> tags inserted after each line are the PGP messages. Everything else (name, address, etc etc) is plain text.

    I checked both Thunderbird and Outlook. Same.

    Here's a snippet from the email source:

    http://www.pastie.org/2341366

    Stymied! What do you think?!?

    Posted 13 years ago on Monday August 8, 2011 | Permalink
  8. If it's happening only in the PGP output then it's something to do with your custom code. I would start there. The fact that they are only appearing as part of the PHP Message would tell me that it's related to the code that it generating the PGP or inserting it into the Gravity Form entry.

    Posted 13 years ago on Monday August 8, 2011 | Permalink
  9. frey1esm
    Member

    I'm using the hook 'save_field_value', so is it possible that using the hook is bypassing the "disable auto-formatting' function?

    There's nothing in my code that would ever insert html.

    Posted 13 years ago on Monday August 8, 2011 | Permalink
  10. Sounds like you're inserting the PGP message into the entry using the gform_save_field_value hook? Can you post the code you're using with that hook? And what type of field is that value being inserted into?

    The "disable auto-formatting" setting is for the notification only, not creation of the entry.

    Posted 13 years ago on Monday August 8, 2011 | Permalink
  11. Also, can you post what you're using as your admin notification?

    Posted 13 years ago on Monday August 8, 2011 | Permalink
  12. frey1esm
    Member

    Hi Chris,

    Here's the hook code:

    http://www.pastie.org/2342262

    That field is a 'single line text' field in the form, and a mysql type "text" in the db.

    Here's the notification code:

    http://www.pastie.org/2342274

    Posted 13 years ago on Tuesday August 9, 2011 | Permalink
  13. Probably not related and just a typo, but you're using both $encrypted_field and $encrypted_myfield in there. You're setting $encrypted_myfield but returning $encrypted_field.

    Looking at the rest now...

    Posted 13 years ago on Tuesday August 9, 2011 | Permalink
  14. Looking more carefully at this, it appears the "Disable Auto-formatting" works to not format your carefully crafted admin notification, but data stored in the entry with new lines is run through nl2br which converts all the new lines in the entry to < br / >.

    I don't think you'd see it in this form anywhere else since all the other inputs are single line (no new lines.) But the PGP block is stored with new lines, and on the way to the notification it's run through nl2br, which is adding those breaks. It has nothing to do with PGP. It just happens that there are new lines in that field after you store it.

    I forwarded this information to the developers and expect we'll hear back here soon with an explanation. Thanks for your patience.

    Posted 13 years ago on Tuesday August 9, 2011 | Permalink
  15. That is correct, after discussing this issue with our lead developer the field output is still being auto-formatted. The disable auto-formatting only disables it on your notification message text that you add. This is so that users can create full HTML emails without auto-formatting causing problems. HOWEVER in that situation you still want the fields to be auto-formatted, otherwise paragraphs would run together, etc.

    This is an interesting situation because you don't want ANY of it auto-formatted. It sounds like you want is more of a plain text email which would solve the auto-formatting issue entirely because the entire email would be plain text. The problem with this is it's not currently a feature, a plain text feature is coming in the v1.6 release that is in development and will be released as a beta release later this week. You will be able to use a hook to tell Gravity Forms to send a specific notification email as plain text, it will then output all of the field values as plain text.

    If you can't wait until v1.6 the solution is going to be to edit the core plugin files themselves to disable the auto-formatting of field output. We might be able to assit you with custom code so that it only applies this non-autoformatting to a specific field on a specific form. BUT this will require editing the core plugin files. Is this something you are comfortable doing if we provide you some instructions?

    Posted 13 years ago on Tuesday August 9, 2011 | Permalink
  16. frey1esm
    Member

    Carl, sure I can do that. Please email me details. Thanks for the help!

    Posted 13 years ago on Tuesday August 9, 2011 | Permalink
  17. frey1esm
    Member

    Carl, I was able to implement a simple hack.

    I will look for the new plaintext feature in 1.6, but for now I have what I need. Thanks for the insight!

    Posted 13 years ago on Wednesday August 10, 2011 | Permalink

This topic has been resolved and has been closed to new replies.