Tag: programmatic

So you want to programmatically fire off a form notification email?  Here's one way to do it.  Let's be clear that I have no idea if this is the "correct" way.  I just got sick of asking this question myself and seeing other people asking it, so I figured I'd try to solve it myself. Also, you'll need to figure out a way to populate the entry id (or entire entry) as well as the action_id.  See the comments in the code.

	$entry_id = 72; // somehow you have to set the entry id of the form entry you're dealing with
	$target_action_id = 177; // id of the action you want to fire off - you can get this from the database WP_POSTS with the post_type = 'frm_form_actions'
				 //  or get it from the FF UI by opening the action and scrolling all the way down to the bottom right where it says "Action ID:

	$entry = FrmEntry::getOne($entry_id, true);
	$form_id = $entry->form_id;
	$type = "email"; // whichever you want
       	$actionToDo = FrmFormAction::get_single_action_type( $target_action_id, $type );

	$form = FrmForm::getOne($form_id);

	FrmNotification::trigger_email( $actionToDo, $entry, $form );

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community