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.

Conditional attachments

  1. MissyW
    Member

    The following post is closed http://www.gravityhelp.com/forums/topic/conditional-notification-and-routing where Carl Hancock said:
    "Gravity Forms can route the Admin Notification to an email based on a choice in a select box, so it can do this part.

    However it can't send a User Notification with a specific attachment based on a choice in a select box. Conditional notification messages are not currently a feature, however it is a feature we plan on adding in the future."

    I also need this feature of sending attachments conditional on values in form fields. However it's not quite straightforward. Firstly, I need to BCC emails to several recipients based on values in the form fields (which I believe I can do with the routing option??). But I ALSO want to send an email back to the person who submitted the form with an attachment which depends on the field values entered.

    Posted 11 years ago on Wednesday February 20, 2013 | Permalink
  2. Routing and BCC are not a feature of Gravity Forms. The routing option is for To addresses only. You could use the gform_pre_submission_filter: http://www.gravityhelp.com/documentation/page/Gform_pre_submission_filter to dynamically change the BCC address based on the form entry. That would work like routing, but would require a little bit of PHP code in your theme's functions.php.

    Conditional attachments can be accomplished a couple of different ways. You can use the gform_user_notification_attachments filter: http://www.gravityhelp.com/documentation/page/Gform_user_notification_attachments

    You would test the entered values and then add the attachments as appropriate. Before that filter came along, you could always provide a link in the email to the attachment on your site. It would not be attached, but available for download.

    Posted 11 years ago on Friday February 22, 2013 | Permalink
  3. MissyW
    Member

    Hi Chris,
    Thanks for such a comprehensive reply!

    Pardon my ignorance (I am new to WordPress), but when you say

    "would require a little bit of PHP code in your theme's functions.php"
    ... do you mean the functions.php in my WordPress theme, or is there a functions.php that comes with a Gravity theme?

    You said,

    "Before that filter came along, you could always provide a link in the email to the attachment on your site. It would not be attached, but available for download."

    ... thanks for thinking outside the box! :)

    Posted 11 years ago on Friday February 22, 2013 | Permalink
  4. functions.php in your current theme or child theme folder

    Did you have any other questions? What you want to do can be accomplished with just a few lines of PHP.

    Posted 11 years ago on Friday February 22, 2013 | Permalink