Selecting proper company in email token

Your software
My Mautic version is: 2.16.2
My PHP version is: 7.2

Your problem
My problem is:
I have a situation that one contact can have multiple companies. And creation is working as expected, both from dashboard and API.

Now, I have a campaign to notify the user on the status of their companies (Company A trial expired, Company B payment success etc.).

I created segments that contains the contacts based on company fields and then I have campaigns that are run for various segments.

All that works just fine until the email is sent. Mautic always take the information from primary company which results in sending misleading information to the contacts.

So for example: Company A is primary company for a contact.

Company A have trial expired, the campaign is run and the contact received proper email with Subject Company A trial expired

Howerver, in case of company B having their payment failed the campaign should send email with subject Company B have failed payment. But instead, the contact received subject Company A have failed payment

I guess this is a bug, or there is some work around it which I can’t figure out.
Did anybody else came across similar issue?

Steps I have tried to fix the problem:

Hello @goranculibrk,

To start with I suggest you upgrade Mautic to the latest version :wink:
Can you explain your business use case? Why do you have a contact that is attached to two companies?


I have many contacts that are atteched to multiple companies :smiley:

Hello @joeyk,

Thanks for your feedback.
What is the concrete business use case? What do you need it for?


There are many many :slight_smile:

Let’s say you have many agencies (stored as contact) who serves multiple partners (store as company).
One agency can have many companies. Companies have different custom fields, for example

  • logo color
  • logo size
  • logo material

You as the provider through agencies you can notify all your agencies who have partners (saved as company) in case there is a discount in yellow, metal logo materials.