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

add example implementation of salutation placeholders in demo #247

Open
wants to merge 1 commit into
base: next
Choose a base branch
from

Conversation

juliawegmayr
Copy link
Contributor

@juliawegmayr juliawegmayr commented Dec 10, 2024

Description

Add an example on how to implement the salutation placeholder in RichTextBlock in demo.

Screenshots/screencasts

Admin:
Screenshot 2024-12-10 at 14 24 10

Newsletter - Female:
Screenshot 2024-12-10 at 14 15 19

Newsletter - Male:
Screenshot 2024-12-10 at 14 18 35

Newsletter - No salutation filter selected:

Screenshot 2024-12-10 at 14 23 40

Changeset

[x] I have verified if my change requires a changeset

Related tasks and documents

(https://vivid-planet.atlassian.net/browse/COM-1032)

@juliawegmayr juliawegmayr self-assigned this Dec 10, 2024
@juliawegmayr juliawegmayr force-pushed the add-salutation-to-demo branch from a3e586a to af9c72f Compare December 10, 2024 13:26
@juliawegmayr juliawegmayr marked this pull request as ready for review December 10, 2024 13:27
@auto-assign auto-assign bot requested a review from raphaelblum December 10, 2024 13:27
@juliawegmayr juliawegmayr requested review from RainbowBunchie and raphaelblum and removed request for raphaelblum December 10, 2024 13:27
const placeholders = [
{
placeholder: "{{SALUTATION}}",
helper: <FormattedMessage id="newsletter.richText.placeholder.salutation" defaultMessage="Dear Mr./Ms.LASTNAME" />,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
helper: <FormattedMessage id="newsletter.richText.placeholder.salutation" defaultMessage="Dear Mr./Ms.LASTNAME" />,
helper: <FormattedMessage id="cometBrevoModule.richText.placeholder.salutation" defaultMessage="Dear Mr./Ms. LASTNAME" />,

<RichTextBlock.AdminComponent {...rteAdminComponentProps} />
</Box>
<FormLabel>
<FormattedMessage id="newsletter.richText.placeholder.info" defaultMessage="Placeholders available in the text" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<FormattedMessage id="newsletter.richText.placeholder.info" defaultMessage="Placeholders available in the text" />
<FormattedMessage id="cometBrevoModule.richText.placeholder.info" defaultMessage="Placeholders available in the text" />

Comment on lines +7 to +11
export const getPreparedHtml = (html: string) => {
return html
.replace(new RegExp(HIDE_IN_OUTLOOK_START_IF, "g"), "<!--[if !mso]><!-- -->")
.replace(new RegExp(HIDE_IN_OUTLOOK_END_IF, "g"), "<!--<![endif]-->");
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this needed for the placeholders? Won't they be replaced via brevo anyways or am I missing something?

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.

2 participants