Hi, I’m trying to download an email as described in the documentation using the folowing code
import stream from “stream”;
import { promisify } from “util”;
import fs from “fs”;
import got from “got”;
import { simpleParser } from “mailparser”;
// Now read the file and parse its contents into the parsed variable
// See Mailparser :: Nodemailer for parsing options
const f = fs.readFileSync(/tmp/raw_email);
this.parsed = await simpleParser(f);
but steps.trigger.event.mail.content_url is undefined.
I tried also steps.trigger.event.attachements.contentUrl but it’s failing too.
And I am getting this error when I try to execute it
TypeError
Cannot read property ‘content_url’ of undefined
DETAILS
at Object.run (file:///tmp/__pdg__/dist/code/673ef0ebffa705d73ef36436ead5414b3b0d1ad7de98aca160cd8d52d8763d33/component.mjs:27:42)
at global.executeComponent (/var/task/launch_worker.js:146:53)
at MessagePort.messageHandler (/var/task/launch_worker.js:618:28)
Question : which URL shall I pass to got.stream() if my trigger is an email with an attachement ?
A TypeError is Javascript trying to tell you that the property you’re attempting to access doesn’t exist.
Please double check the incoming variable from the step exports and make sure those properties exist.
Specifically, I recommend logging the content of steps.trigger.event, I would guess you’re missing an extra body property, then going into mail.content_url.
today, I was about to progress on this but it’s look like i cannot access and edit anymore my workflow.
I am getting this screen “preparing” without any possibility to edit trigger & steps.