showEmailEditor

client.showEmailEditor({
  container: HTMLElement|id,
  accessToken: string,
  // Optional arguments
  showLabels: boolean,
  redirectUrl: boolean,
  onReady: function,
  theme: object,
  i18n: object,
})

Description

Show the widget for the current profile to change their email after authentication.

For more on updating emails, see our Email address management page.
  • The associated profile must have been granted the full_write scope at the last authentication.

  • The email update template must enabled and configured in the ReachFive Console.

Examples

const accessToken = // Here paste the authorization token of the profile retrieved after login

client.showEmailEditor({
    container: 'email-editor-container',
    accessToken,
    showLabels: true,
    redirectUrl: 'https://example.com/profile-editor',
    onReady: instance => {
      // Destroy the widget
      // if (...) instance.destroy()
    },
    theme: {
      primaryColor: '#274890',
      borderRadius: '#374890'
    },
    i18n: {
        'emailEditor.successMessage': 'Please check now your mailbox to confirm your new email address.'
    }
})

Widget

showEmailEditor

Parameters

Parameters Description

container HTMLElement id

The DOM element or the id of a DOM element in which the widget should be embedded.

accessToken string

The authorization credential JSON Web Token (JWT) used to access the ReachFive API, less than five minutes old.

i18n object

Widget labels and error messages to override. Falls back to the default wordings in en, fr, es, it and nl.

For example, you might re-word the emailEditor.successMessage or change the way other wordings display to the user while leaving the remaining text on the widget intact.

onReady function

Callback function called after the widget has been successfully loaded and rendered inside the container. The callback is called with the widget instance.

redirectUrl string

The URL sent in the email to which the user is redirected. This URL must be whitelisted in the Allowed Callback URLs field of your ReachFive client settings.

showLabels boolean

Whether the signup form fields' labels are displayed on the login view.

Defaults to false.

theme object

The options to set up to customize the appearance of the widget.

primaryColor string

The button and link default color.

Default to #229955.

borderRadius string

The radius of the social login button and other input (in px).

This can be used to make inline and/or circle social login buttons.

Default to 3.

socialButton object

Social button theming options.

Parameters
  • inline- Boolean that specifies if the buttons are inline (horizonally-aligned).

  • textVisible - Boolean that specifies if the text is visible.

  • fontWeight - Specifies the font-weight (such as normal, bold, or 900).

  • fontSize - Specifies the font-size.

  • lineHeight - Specifies the line-height.

  • paddingX - Specifies the padding for the x axis. (left and right)

  • paddingY - Specifies the padding for the y axis. (top and bottom)

  • borderRadius - Specifies the border-radius.

  • borderWidth - Specifies the border-width.

  • focusBoxShadow - Boolean that specifies if there is a box shadow on the button or not.