parse-community / parse-server-api-mail-adapter

API Mail Adapter for Parse Server
MIT License
27 stars 18 forks source link

Extra values are not present in callback payload #92

Open Mammut-Felix opened 9 months ago

Mammut-Felix commented 9 months ago

New Issue Checklist

Issue Description

When additional properties are defined in sendMail(options), they aren't present in the payload of the callback.

Steps to reproduce

Parse.Cloud.sendEmail({
      templateName: 'testTemplate',
      placeholders: {
        name: 'Test',
      },
      recipient: 'testmail@domain.com',
      extra: {
        testKey: 'testValue'
      }
})

Actual Outcome

config.emailAdapter = {
    module: 'parse-server-api-mail-adapter',
    options: {
      sender: '..',
      templates: { ... },
      apiCallback: async ({ payload, locale }) => {
        console.log(payload)
      })
  }
}

output:

{
  from: '...',
  to: '...',
  subject: 'Test\n',
  text: '...',
  html: '<html>\n' +
    '  <body>\n' +
    '    <p>Test</p>\n' +    
    '  </body>\n' +
    '</html>\n'
}

Expected Outcome

The properties set in extra should be present somehow.

Failing Test Case / Pull Request

Environment

Logs

parse-github-assistant[bot] commented 9 months ago

Thanks for opening this issue!

mtrezza commented 9 months ago

Isn't there a test case for this?