Using additional field from contact owner in each email campaign

Your software
My Mautic version is: 3.3.2
My PHP version is: 7.4.14
My Database type and version is: MySQL 5.7.28

Your problem
My problem is:

I have the following scenario:
My clients should be able to use predefined mautic email campaigns made by the admin.
They have a unique number/id in a different database. This number should be printed out dynamically in each email based on their campaign.

So my approach is to create a dynamic field for this number which will then be used in the emails.
Example:
When one client purchases one campaign, a company is created in mautic with the unique number as additional field.
Now the campaign should start to run and use the unique number of this newly created company in each of the campaign’s email as dynamic field. The company is so to say the owner of the leads for this campaign.

Does this work? If not, how can I get this to work?
Can anybody help me out?
Thx in advance.

Campaign or Segment email?
I want to help, cause it seems interesting, but I’m a bit confused. Maybe make a video.

Thanks for your reply @joeyk .
let me try to explain more detailed:

Basically my clients book predefined marketing campaigns. these run in the mautic software.
on my platform where I offer these campaigns, each client has a unique id (or name or any other type of data, but lets stick to the id).

Now my approach was/is to add the clients that purchased the predefined campaigns to the mautic database as user or company (because they can be owner of a contact lead).
While doing that, a custom field for object user/company with this id should be filled out. (This is a connection to my platform and a lot of other stuff, email won’t work as this id is used in links e.g.)

after that, the email campaign that was chosen by the client should launch and each email inside, that has the fieldname (e.g. {ownerfield=data_field} ) in it, should display the correct id of the client aka user/company in mautic.

my latest try is using the user->position field for the id. it seems to work in a test email sent to a contact (owned by a user) but i didn’t try it in a campaign yet.

but maybe there is a better/cleaner way?
would love to have a simpler solution :slight_smile:

There is a more sophisticated option, I could explain to you in the next Mautic Helpdesk Meetup 4th of May. I could screenshare it to you.

Right you can only work with these fields (owner email is one of them):
https://docs.mautic.org/en/setup/variables

why cant you explain here?
would be a lot easier for everyone :wink:

Ok.
You can use the twig plugin to generate custom content using IF and the email of the owner.
So if the owner’s email A then links should be A
If owner is B, then link should be B
Here is more about the TWIG content:

i think this would be way too much work if there are hundreds of owners. I cant do the IF clauses for each owner. I’m sorry, but if I got your answer right, this is not suitable for my solution. I need to find something better. :slight_smile:

Sorry to revive the dead!

Could this be achieved by creating a new custom field for the owner? (I believe this would require work on the db.) Like the following…

…with, for example, {ownerfield=ownerid}.

This would be especially useful if this field had an API endpoint that could be updated from whatever 3rd party app is generating the unique ID in the first place.

EP