Hi @v-yutliu-msft ,
Thanks a lot for your help!
Here are my answers to your questions:
1) What does the receiver's phone language mean? Do you mean the location in someone's office365 profile ?
No, I don't mean the location in someone's office365 profile. I mean the selected language in the settings of the smartphone of the user. For instance, if the smartphone of my user is in Turkish, PowerApps will be in Turkish, and the format of the date that is sent by mail will also be in Turkish (instead of seeing "Janvier", I'd see "Ocak"). Please note that the issue is not about the receiver's phone language, but about the sender's phone language.
2) The the email's content will change with the receiver's phone language or the sender's phone language?
The language in which the dates are formatted in the email is changing depending on the SENDER's phone language.
The receiver's phone language doesn't impact the process.
3) The SendMail code is a bit messy, since there are many different conditions depending on the user's profile.
But here's how the content of the mail is coded (pretty simple):
- LookUp(HTMLTemplate,Row = 1).Value
It simply looks up the data in the HTML Template Collection after the placeholders were replaced with the Leave Request data of the user. That step is done like this:
ForAll(HTMLTemplate, Patch(EmailData,LookUp(HTMLTemplate,If(_managerView,Row = 2,Row = 1)),{Value: Substitute(LookUp(
EmailData,If(_managerView,Row = 2,Row = 1)).Value,Field,Data)}));
4) Regarding the test you made: please note that the date format that I used is not the same: "[$-fr-FR]mmm. dd, yyyy" is the one I used (the month isn't displayed with numbers, but with the first three letters (i.e.: "Jan" for "January" and not "1"). This is how the problem can be noticed. When using numbers, the problem cannot be seen.
I actually reached a temporary solution yesterday by changing the format of the date in the email and only using numbers, as you did in your test. Instead of showing the first three letters of the month followed by the day (i.e.: Jan. 16), it shows only numbers (01/16/2020). But still, if date formatting is important for other people and they must show the month in letters, this could be a problem.
Regards,