If I'm understanding you correctly you have a similar problem to what I had; the user is able to type in something which can include line breaks and you want that to appear with line breaks in the email triggered by the Email Trigger function?
If so this is what I did (in Vue but can obviously be changed as appropriate).
I have a data property called 'message' and that automatically changes line breaks to \n. What I'm doing is saving a copy of the form to one collection ('enquiries') and triggering an email by writing to a different collection ('email').
In my function to do both of these I'm just using a different variable to change the line breaks to use the HTML tag
let HTMLmessage = this.form.message.replace(/\n/g, '<br/>');
Then when I'm adding to the email collection it's taking that:
db.collection('email').add({
to: 'example@domain.com',
template: {
name: "template_name",
data: {
name: this.form.name,
email: this.form.email,
phone: this.form.phoneNumber,
message: HTMLmessage
}
},
replyTo: this.form.email,
from: this.form.email,
})
And in the email template ("template_name") in the exam above it is using the triple handbars:
<p>{{{message}}}</p>
This then preserves the line breaks in the email

There might well be better ways of doing it but this worked for me. In summary:
- Replace the \n with the HTML tag and then send that to the template
- Ensure the template uses the triple handlebars for that particular field