Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disappearance of a substitution variable when sending email to multiple recipients #31310

Open
corent1lb opened this issue Oct 7, 2024 · 14 comments
Labels
Bug This is a bug (something does not work as expected) Event: Devcamp 2024 Nancy

Comments

@corent1lb
Copy link

Bug

Some substitution variables when used in an email template are not displayed in the body of the email (when writing) when you send an email to several Third Parties via the invoice list

Dolibarr Version

20.0.0

Environment PHP

8.2.22

Environment Database

MariaDB 11.4.3

Steps to reproduce the behavior and expected behavior

When you are in the list of invoices, you check several invoices and click on "select an action" and click on "send email", if the selected mail template contains the variable "ONLINE_PAYMENT_URL" then when you apply this mail template, this variable is absent (I dont mean present in the body and then the recipient does not receive the link) from the body of the mail.

I use other variables in my mail template and it works correctly for the others, only this one is problematic.

Attached files

My email template :
pic02

The email template when selected in invoices list :
pic01

@corent1lb corent1lb added the Bug This is a bug (something does not work as expected) label Oct 7, 2024
@corent1lb
Copy link
Author

Une solution ?

@corent1lb
Copy link
Author

Le bug est toujours présent dans la version 20.0.2

@lemathou
Copy link
Member

You are writing "when you send an email to several Third Parties via the invoice list".
In the default installation, I do not see the possibility to send invoices to each customer, but to send many invoices to destinations, using the group action "Send email".

One email will be send, containing all the invoices, for each email in the destination field.
This does not send an email by invoice to each customer.

@corent1lb
Copy link
Author

I mean when you check multiple invoices in invoices list, then you select "send an email" and it send email to the third party attached to the invoice checked.
I described step by step how to reproduce the probleme :

"When you are in the list of invoices, you check several invoices and click on "select an action" and click on "send email", if the selected mail template contains the variable "ONLINE_PAYMENT_URL" then when you apply this mail template, this variable is absent (I dont mean present in the body and then the recipient does not receive the link) from the body of the mail."

@lemathou
Copy link
Member

The functionnality is not the same for me :

You say : "I mean when you check multiple invoices ... and it send email to the third party attached to the invoice checked."

On my installation, this does not send an email "to the third party attached to the invoice checked".
This send an email to the destination addresses you choose, with all the invoices checked attached at once.

@lemathou
Copy link
Member

OK I think I am missing informations on my thirdparties, on a production instance, it seems to work as you describes... I look in more precisely.

@corent1lb
Copy link
Author

This should be clearer with a screenshot :
sdgfdsfg

@lemathou
Copy link
Member

lemathou commented Nov 15, 2024

Yes this is what I am doing but on my fresh install for testing, I had not the same behaviour, soi I tried on a production instance and I can see exactly what you said, so now I am working on it.

@lemathou
Copy link
Member

I fixed it, since version 16, when we do not click on "one email per recipient".
#31927
We shall wait the fix to be merged.

@lemathou
Copy link
Member

@corent1lb Can you tell me if the fix solves your problem ?

@corent1lb
Copy link
Author

Nope, it don't solve the problem and the modification in html.formmail.class.php cause an error 500 when I want to modify an email template

@lemathou
Copy link
Member

On my fresh 20 I do not see an error... I have warnings (already there, not caused by the fix), but this is working.
I tested modifying the template :

  • in the mass action in invoices context
  • in the dedicated menu to update templates

Can you send me a screen shot or at least more debugging information ?

@corent1lb
Copy link
Author

Hi,
Some additional information:
The 500 error appears when I modify the email template in the dedicated menu.
I haven't been able to find any more debug information. Is there a particular dolibarr log that could help solve the problem ?

@corent1lb
Copy link
Author

I've update to 20.0.3 and there is still the same problem. Any log that can help to fin why ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This is a bug (something does not work as expected) Event: Devcamp 2024 Nancy
Projects
None yet
Development

No branches or pull requests

3 participants