Skip to content

Conversation

DHANUSHRAJA22
Copy link

What kind of change does this PR introduce?

Bug fix - Allows newlines (\n) in SMS and MFA OTP templates to be properly converted to actual newlines in the template parsing.

What is the current behavior?

Currently, when users include \n in SMS or MFA phone OTP templates expecting newlines, these escaped newline characters are not converted to actual newlines. This means multi-line SMS templates don't work as expected.

What is the new behavior?

The fix adds strings.ReplaceAll(template, "\\n", "\n") processing for both SMS and MFA phone templates before parsing. This allows users to include \n in their template configuration and have it properly converted to actual newlines in the final SMS message.

Additional context

This change affects both:

  • Regular SMS templates (config.Sms.Template)
  • MFA phone templates (config.MFA.Phone.Template)

What kind of change does this PR introduce?

Bug fix - Allows newlines (\n) in SMS and MFA OTP templates to be properly converted to actual newlines in the template parsing.

What is the current behavior?

Currently, when users include \n in SMS or MFA phone OTP templates expecting newlines, these escaped newline characters are not converted to actual newlines. This means multi-line SMS templates don't work as expected.

What is the new behavior?

The fix adds strings.ReplaceAll(template, "\\n", "\n") processing for both SMS and MFA phone templates before parsing. This allows users to include \n in their template configuration and have it properly converted to actual newlines in the final SMS message.

Additional context

This change affects both:

  • Regular SMS templates (config.Sms.Template)
  • MFA phone templates (config.MFA.Phone.Template)

What kind of change does this PR introduce?

Bug fix - Allows newlines (\n) in SMS and MFA OTP templates to be properly converted to actual newlines.

What is the current behavior?

Currently, when users include \n in SMS or MFA phone OTP templates expecting newlines, these escaped newline characters are not converted to actual newlines. This means multi-line SMS templates don't work as expected.

What is the new behavior?

This fix adds strings.ReplaceAll(template, "\\n", "\n") processing for both SMS and MFA phone templates before parsing. This allows users to include \n in their template configuration and have it properly converted to actual newlines in the final SMS message.

Additional context

This change affects both regular SMS templates (config.Sms.Template) and MFA phone templates (config.MFA.Phone.Template). The fix is applied consistently to both template processing paths in the populateGlobal function within internal/conf/configuration.go.The fix is applied consistently to both template processing paths in the populateGlobal function within internal/conf/configuration.go.The fix is applied consistently to both template processing paths in the populateGlobal function within internal/conf/configuration.go.## What kind of change does this PR introduce?

Bug fix, feature, docs update, ...

What is the current behavior?

Please link any relevant issues here.

What is the new behavior?

Feel free to include screenshots if it includes visual changes.

Additional context

Add any other context or screenshots.

…)fix: allow newlines in SMS/MFA OTP templates (translate \n to newline)Update configuration.go
…fa-newlineDHANUSHRAJA22-patch-1

fix: allow newlines in SMS/MFA OTP templates (translate \n to newline)fix: allow newlines in SMS/MFA OTP templates (translate \n to newline…
@DHANUSHRAJA22 DHANUSHRAJA22 requested a review from a team as a code owner August 25, 2025 14:56
@hf
Copy link
Contributor

hf commented Aug 26, 2025

Interesting!

@uncenter
Copy link

Just a warning that this contributor's contributions are fully LLM-generated - see microsoft/terminal#19274, facebook/react#34315, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants