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

testing API key not enough with sendEmailWithTemplate method #56

Closed
Oloompa opened this issue Sep 2, 2019 · 1 comment
Closed

testing API key not enough with sendEmailWithTemplate method #56

Oloompa opened this issue Sep 2, 2019 · 1 comment

Comments

@Oloompa
Copy link

Oloompa commented Sep 2, 2019

Hi,

I implement test. I use process.env.POSTMARK = "POSTMARK_API_TEST";

in documentation i can read:

it helps ensure that your messages will be accepted by the API

Sadly, if it help to init postmark library without any error, it doesn't allow me to call sendEmailWithTemplate() method. I got the following error:

ApiInputError {
    code: 1101,
    statusCode: 422,
    message: 'The Template\'s \'Alias\' associated with this request is not valid or was not found.',
  }

I used welcome as alias. Any well formed alias should be ok as i am using the test API key.

@atheken
Copy link
Contributor

atheken commented Sep 2, 2019

Hi @Oloompa

The issue here is that this type of test is not currently possible within the Postmark API. This is because, in order to validate a template sending request, we need to be able to match your API call against your Postmark Server. Normally we would do this with your server token, but with the test api key, there is no way to verify that welcome is a template associated with your server.

This is definitely something we're aware of as needing improvement in our API, but not an issue with this specific library. If you'd like some guidance on how to test, please feel free to contact support and they can give you some suggestions.

@atheken atheken closed this as completed Sep 2, 2019
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

No branches or pull requests

2 participants