#133307 email2 not available for forms

Landing Forums JupiterX WordPress Theme email2 not available for forms

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • Thomas Chandler

    Hello,

    I’m attempting to use the email2 feature for the elementor form field but I only have the option for email, email2 is not showing as an action in the settings for the form.

    Amir Rather Support Team

    Hi There

    You can use the Reply-To https://take.ms/bIkzV for this purpose.
    and enter an email address to which you can send a reply when the message is received. By default, if this field is empty, the reply will be sent to a sender. You can change it and add other email addresses in Cc and Bcc fields. You can also set it as one of the Email fields inside the form so it sets dynamically as the user fills that field.

    Let us know if you mean something else.

    Regards

    Thomas Chandler

    Thanks for your quick response!

    I actually need to use email2 for the custom response message feature so I can limit what information gets to the user who submits the form.

    Sending Email Confirmations with Elementor Forms | Elementor

    thanks!

    Mohsin Al-Rabieai Support Team

    Hi Thomas,

    There is no option to edit the Email template right now. If you want to edit it, you need to edit this function on wp-content/plugins/jupiterx-core/extensions/raven/includes/modules/forms/actions/email.php directly:

    public static function run( $ajax_handler ) {
    		$email_to               = $ajax_handler->form['settings']['email_to'];
    		$email_subject          = $ajax_handler->form['settings']['email_subject'];
    		$email_name             = $ajax_handler->form['settings']['email_name'];
    		$email_from             = $ajax_handler->form['settings']['email_from'];
    		$email_reply_to_options = ! empty( $ajax_handler->form['settings']['email_reply_to_options'] ) ? $ajax_handler->form['settings']['email_reply_to_options'] : 'custom';
    		$email_reply_to         = $ajax_handler->form['settings']['email_reply_to'];
    		$name_reply_to          = $email_name;
    		$email_cc               = ! empty( $ajax_handler->form['settings']['email_cc'] ) ? explode( ',', $ajax_handler->form['settings']['email_cc'] ) : [];
    		$email_bcc              = ! empty( $ajax_handler->form['settings']['email_bcc'] ) ? explode( ',', $ajax_handler->form['settings']['email_bcc'] ) : [];
    		$confirmation           = ! empty( $ajax_handler->form['settings']['confirmation'] ) ? $ajax_handler->form['settings']['confirmation'] : false;
    		$body                   = '';
    
    		// Body.
    		foreach ( $ajax_handler->form['settings']['fields'] as $field ) {
    			$body .= $field['label'] . ': ' . $ajax_handler->record['fields'][ $field['_id'] ] . '<br>';
    
    			if ( self::get_reply_to_name( $field, $ajax_handler->record['fields'][ $field['_id'] ] ) && 'custom' !== $email_reply_to_options ) {
    				$name_reply_to = self::get_reply_to_name( $field, $ajax_handler->record['fields'][ $field['_id'] ] );
    			}
    		}
    
    		$body .= '<br> ---- <br><br>';
    		/* translators: %s: Today date */
    		$body .= sprintf( __( 'Date: %s', 'jupiterx-core' ), date_i18n( 'F j, Y' ) ) . '<br>';
    		/* translators: %s: Today time */
    		$body .= sprintf( __( 'Time: %s', 'jupiterx-core' ), date_i18n( 'h:i A' ) ) . '<br>';
    		/* translators: %s: Referrer URL */
    		$body .= sprintf( __( 'Page URL: %s', 'jupiterx-core' ), $ajax_handler->record['referrer'] ) . '<br>';
    
    		/**
    		 * Filter for Email body.
    		 *
    		 * @param array $body Form Body Fields.
    		 * @param array $ajax_handler->form['settings'] Form Fields.
    		 * @since 1.20.0
    		 */
    		$body = apply_filters( 'jupiterx_elements_form_email_body', $body, $ajax_handler->form['settings'], $ajax_handler->record['fields'] );
    
    		/**
    		 * Whether to strip the email body.
    		 *
    		 * @since 1.23.0
    		 */
    		$body_stripped = apply_filters( 'jupiterx_elements_form_email_body_stripped', true );
    
    		if ( $body_stripped ) {
    			$body = stripslashes( $body );
    		}
    
    		$headers[] = 'Content-Type: text/html';
    		$headers[] = 'charset=UTF-8';
    		$headers[] = 'From: ' . $email_name . ' <' . $email_from . '>';
    
    		if ( 'custom' !== $email_reply_to_options ) {
    			$email_reply_to = $ajax_handler->record['fields'][ $email_reply_to_options ];
    		}
    
    		if ( ! empty( $email_reply_to ) ) {
    			$headers[] = 'Reply-To: ' . $name_reply_to . '<' . $email_reply_to . '>';
    		}
    
    		if ( ! empty( $email_cc ) ) {
    			foreach ( $email_cc as $email ) {
    				$headers[] = 'Cc: ' . $email;
    			}
    		}
    
    		if ( ! empty( $email_bcc ) ) {
    			foreach ( $email_bcc as $email ) {
    				$headers[] = 'Bcc: ' . $email;
    			}
    		}
    
    		wp_mail( $email_to, $email_subject, $body, $headers );
    
    		if ( 'yes' === $confirmation ) {
    			self::send_confirmation_email( $ajax_handler, $email_name, $email_from, $body );
    		}
    
    		$ajax_handler->add_response( 'success', 'Email sent.' );
    	}
    
    /**
    	 * Send confirmation email.
    	 *
    	 * @since 1.9.5
    	 * @access private
    	 * @static
    	 *
    	 * @param object $ajax_handler Ajax handler instance.
    	 * @param string $email_name Email name.
    	 * @param string $email_from Email from.
    	 * @param string $body Email body.
    	 */
    	private static function send_confirmation_email( $ajax_handler, $email_name, $email_from, $body ) {
    		$headers[] = 'Content-Type: text/html';
    		$headers[] = 'charset=UTF-8';
    		$headers[] = 'From: ' . $email_name . ' <' . $email_from . '>';
    
    		// Email field.
    		$email = array_filter( $ajax_handler->form['settings']['fields'], function( $field ) {
    			return 'email' === $field['type'];
    		} );
    
    		// First email field.
    		$email = reset( $email );
    
    		// Email address.
    		$email_to = $ajax_handler->record['fields'][ $email['_id'] ];
    
    		wp_mail( $email_to, esc_html__( 'We received your email', 'jupiterx-core' ), $body, $headers );
    	}

    I recommend you to use the Confirmation Message option in the Email settings as it will do the same thing as Email2, you just can’t edit the template.

    If you need advanced email-catching features, you may want to take a look at Growmatik.ai and see how you can integrate it with your form. It’s a great marketing tool afterall.

    Bests

Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic.
Login