I’ve tried different approaches, but non worked. For example I’ve tried campaigns, but couldn’t find a way to use Formfields in the Campaign E-Mails.
I cannot accept that this couldn’t be possible in a easy way. This Form gonna replace a Powermail Form in TYPO3 and there it kind of works like a charm. Is there a way to do this out of the box or with a workaround?
A really dirty workaround is to define the the Radiobuttons as E-Mail and then tell the Action to send the Mail to the “Contact” - but then of course you don’t have the customer E-Mail. But the workaround shows how desperate I am.
I would create custom fields to save that “person in charge” email address, along with custom fields for all the fields that you’d like to include in the notification email, so they can be saved to the contact record.
Set the form to update those fields, and then use a campaign to send the email notification; in the campaign, use the “send email to user” action and, in the To field, write `{contactfield=person_in_charge}’ (or whatever ID that field has).
You can create your form as a campaign form and use it to trigger the campaign directly, or create it as a standalone form and have it add them to a segment that triggers the campaign (if you use the latter option, make sure to add a step to the campaign that removes the contact from the segment, so if they submit a second enquiry the campaign will be repeated).
Make sure the campaign is set to allow contacts to restart it.
The Problem with this is, that using a campaign would be kind of complex. In my case I’ve a installation with 5 country pages and a total of 9 translations. The Radiobuttons are always different, so every page and every country site has it’s own contact form with arround 5-9 options (e-mails) to choose from.
And I’m only talking about the contact forms, there also others forms.
So this would blow up the overhead to a limit the customer would never ever pay for and I totaly get that, cause it’s such a simple task.
Is there no other way? Or would it be an option to create like a plugin which does the job? Would it be possible to like change the “submit action” “send form results” and make an extension / plugin out of it?
An alternative just sprung to mind (I haven’t been able to test it), but have you tried on the form setting the department radio button values as those email addresses (you could still set the labels to “General question”, " Sales",etc, so it wouldn’t look different for your users). In the form actions, add a “send form results” action and, in the To field, reference the department field (eg {form field=which_department} - you’ll find the exact string to use is already in the body of the email).
Like I say, I haven’t tested this, but it might work!
Not sure if you ment it this way. This works like a charm, but in practice, I loose the customer (Lead) E-Mail, because the Radiobutton result is saved to the Leads E-Mailfield.
That’s why I was thinking about a Plugin to solve this by adding additional Features to the Formaction “Send Form Results” - in case this is possible in Mautic.
Hi,
I’m really @lufi asked this scenario, because shows how flexible Mautic can be.
In my opinion you should take advantage of the “contact ownership” concept built into Mautic.
1. Create multiple users in Mautic
One for each role you’d like to have: info, sales, support.
2. Assign owner
Once a person fills out the form, you can assign contact owner as a campaign step based on the radio button choosen.
3. Send email to user
From this moment you are able to send email to a specific Mautic user as campaign step:
Make sure you are turning on the switched called “send to contact owner”
4. Contact ownership is everywhere
Contact ownership can used in conditions, you can change via campaign steps. You can send email to user via Forms
5. Set identity in emails
Sender identity can be set as “send from owner” on any email using the advanced tab!
No, just for the data you want to save and use later.
If it’s the same field between forms, then you can just save one. In case it’s okay to overwrite it.
J
I really love Mautic and its extensiveness. It’s just a great and powerful tool.
But at this point it totally misses the market. For me it just feels so wrong and like a big error by design, when you have to create fake fields to handle formfields for such a simple task.
Not talking about the problem when the user overwrite his records before the data being send.
As mentioned this is so easy to do in TYPO3 with Powermail and so I was thinking about creating a plugin, but the documentation on this is really bad.
So here is my solution, as I was looking for simple solution for me as well as the customer.
Solution is tested and worked like a charm for me. Here’s what you can do, for everyone also looking something like this:
Create 1 custom field and label it “Owner (form)” - set Type to Text
Create 2 MySQL Trigger as follows (just copy the code 1:1, should work out of the box):
DELIMITER ;;
CREATE TRIGGER `set_lead_owner_from_radiobutton_on_insert` BEFORE INSERT ON `leads` FOR EACH ROW
IF (NEW.owner_form != NULL) THEN
IF (SELECT count(id) FROM users WHERE users.id=NEW.owner_form) > 0 THEN
SET NEW.owner_id = NEW.owner_form;
ELSE
SET NEW.owner_id = NULL;
END IF;
END IF;;
DELIMITER ;
DELIMITER ;;
CREATE TRIGGER `set_lead_owner_from_radiobutton_on_update` BEFORE UPDATE ON `leads` FOR EACH ROW
IF (NEW.owner_form != NULL) THEN
IF (SELECT count(id) FROM users WHERE users.id=NEW.owner_form) > 0 THEN
SET NEW.owner_id = NEW.owner_form;
ELSE
SET NEW.owner_id = NULL;
END IF;
END IF;;
DELIMITER ;
Create a form with a Radiobutton or Selectbox and set the “Contact Field” to our custom field “Owner (Form)”
Note: Values of the Radiobuttons / Selectboxes need to be set to the User IDs of your Mautic Instance. So you have to create an user for every Select- oder Radiobutton-Option.
Select for example “Send form results” in Actions and set “Send to owner” to yes.
That’s it.
So what does it do. It’s basically all about the MySQL Triggers. Every time a new Lead is created or updated and our custom field “Owner (form)” is not null and has a valid entry (User ID), the trigger copies the value from our field to the original Owner Field of the lead. So we can then use Owner of the Lead (in my case a Department) to send him a E-Mail.
I hope this is helpfull to someone. But even more I hope that Mautic is gonna fix this in the future, as I believe this a very essential task when it come to enterprise Websites.
Hi @lufi
I think this is a super-interesting use case and I think there could be a possibility to make it work.
To sum up the use case (apprx.)
We need to create a form, where one field (department) should determine where the form action email is sent. This is not possible right now. We can access the freshly filled out form data as {formfield=message} and send as Form Action. But the Form Action that sends the email can have either a fixed recipient or the contact owner.
We could save all the form data in custom fields, make it a Campaign form, where we relay the email based on a condition (If contactfield department = eCommerce, owner = John). But this is cumbersome, slow and why would we need to save the data once it’s in the formfield.
Let’s pretend the icecream flavor is connected to the owner. If we can map it the following way:
Then the ownership is designated based on choice and a Form action can send the communication to the right person + set ownership.
Instead of email, we can even have a dropdown that chooses the right owner.
I had basically the same use case and ended up using Zapier to send the email because in our case we couldn’t change the owner.
another option would be to be able to use a token/variable in the campaign action to send the email. In our case, the email address we want to send an alert to is a field on the contact record. Being able to set the “Send email to user” value to {contactfield=rep_email_address} would meet our needs.
Indeed, One can’t send a form to a different email in the form fields that is not the designated “email” of the contact. Big problem, We should just be able to plug in the form field in the To or CC and have it sent there.
I ended up solving this with a Database Trigger. I created two trigger, one for update and one for insert on leads-Table. Both do this:
IF (NEW.owner_form != NULL) THEN
IF (SELECT count(id) FROM users WHERE users.id=NEW.owner_form) > 0 THEN
SET NEW.owner_id = NEW.owner_form;
ELSE
SET NEW.owner_id = NULL;
END IF;
END IF
The Form is configured to send to owner. So as soon as a form inserts a lead, the trigger sets a owner and the form send it.
Not ideal, but really a thing as every of my customers is asking for this feature. I believe it would super beneficial to make this a core feature.