Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • pubsweet pubsweet
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 53
    • Issues 53
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 8
    • Merge requests 8
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • pubsweet
  • pubsweetpubsweet
  • Merge requests
  • !587

Open
Created Aug 19, 2019 by Yannis Barlas@yannisMaintainer
  • Report abuse
Report abuse

WIP: feat(password-reset): allow email options customization

  • Overview 1
  • Commits 1
  • Pipelines 1
  • Changes 3

This allows custom options to be passed to the password reset email through the config.

  • If no custom options are found, it works just as it did before.
  • If the custom options are an object, then it gets merged with the current options.
  • Custom options can be a function, which should return an object, which will in turn be merged as for the point above.

A custom function (which is what I personally need) could look like this:

const customEmailOptions = passwordResetURL => {
  const content = `
    <p>
      Follow the link below to reset your password in the microPublication
      platform.
    </p>
    <p><a href="${passwordResetURL}">Reset your password</a></p>
  `

  return {
    html: content,
    subject: 'Micropublication | Password reset',
  }
}

Then in the config file, I'd add an entry like so:

'password-reset-server': {
  customEmailOptions,
},
Edited Aug 19, 2019 by Yannis Barlas
Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: customize-password-reset-email