Multiple actions in a form? I have two plugins that I want to use in a single form.  One is a Guest Entry plugin to save the data submitted in the form, and the other is a Plugin that sends an email notification when the form is submitted.

I want to use both of these in the same form but I'm not sure how.  If I have

&lt;input type="hidden" name="action" value="guestEntries/saveEntry"&gt;
&lt;input type="hidden" name="action" value="formNotification/getForm"&gt;


It won't work since both have the name "action"
and I can't change the name or the functions never get called.

What can I do to make both of them work?
It’s not possible for a form to simultaneously invoke two controller actions.

You would need to write a plugin that provides its own controller, which in turn could be used to invoke the other controller actions.

class MyPluginController
{
    public function actionSaveEntryAndSendNotification()
    {
        // Save the entry
        craft()-&gt;runController('guestEntries/saveEntry');

        // Send the notification
        craft()-&gt;runController('formNotification/getForm');
    }
}


If "FormNotificationController" is already your own custom plugin, then it might make more sense to just call craft()-&gt;runController('guestEntries/saveEntry'); from the top of actionGetForm(). Or just save the entry yourself from the controller action – the Guest Entries plugin is really pretty simple; most of the heavy lifting is provided by the EntriesService - saveEntry() API.