Responding with the correct callback #33

Open
wants to merge 4 commits into
from

2 participants

@tanguylebarzic

When the messages are queued, the callbacks called once they are sent should be the ones given as argument for each email, not the one of the last email.

@tanguylebarzic

(I agree it seldom happens, just in case).

Regards,

Tanguy

@Marak
Owner

I think this makes a lot of sense. Let me do a sanity check for review and we'll merge.

Thank you!

@tanguylebarzic

Hi,

I added another small fix : if a file was missing, the first time the method was called the callback would be called with the proper error, but the next times, it would never be called.

Another way of fixing it would be to set _templateCache[message.template].error to the error raised, and to respond this for each new call to the method (ie. without having to call readFile each time), but it would mean the server has to be reloaded when the missing file is eventually added, which I didn't like personally.

Regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment