You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I asked Mailgun support this wuestion and they anwered with:
I tried using the request library from the mailgun-js sdk and I was still getting undefined errors. My hunch is the library my not fully support downloading of attachments.
The code they used:
var mailgun = require("mailgun-js");
var Request = require('mailgun-js/lib/request');
var DOMAIN = 'YOUR_DOMAIN_NAME';
var mailgun = require('mailgun-js')({apiKey: 'key-*****************', domain: 'DOMAIN_NAME'});
var options = {
//host will be either sw.api.mailgun.net or se.api.mailgun.net based on the full attachment storage url
host: 'sw.api.mailgun.net',
endpoint: '/v3',
protocol: 'https:',
port: 443,
auth: ['api', api_key].join(':'),
retry: 1
};
var req = new Request(options);
let response = req.request('GET', `/domains/${DOMAIN}/messages/ATTACHMENT_KEY`, function (error, body) {
console.log(body);
});
This was after I tested the same and only received 'undefined' in the 'body'.
I guess my answer does not solve your problem :(
Could you show me how can i download attachment by the message url ?
The text was updated successfully, but these errors were encountered: