icalEvent as Mail

Hi!
I want to send an calendar invitation in an email. So i tried to use node-red-node-email-variable, in the description i see, it can use icalEvents.
But, when i try to set it in the msg.icalEvent i get an error:

ReferenceError: icalEvent is not defined

i do not know, if the error comes from my format or if the node doesn't accept this property!?

How should i use the nodemailer? This is what i try to do:

My flow:

[{"id":"4b960cd753d1354f","type":"tab","label":"Flow 2","disabled":false,"info":"","env":[]},{"id":"2e3a988436c958ee","type":"template","z":"4b960cd753d1354f","name":"ICS","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"BEGIN:VCALENDAR\nVERSION:2.0\nPRODID:https://www.mischok.academy\nMETHOD:PUBLISH\nBEGIN:VEVENT\nUID:{{global.uuid}}\nLOCATION:Mischok Academy - {{payload.raum}}\nSUMMARY:{{payload.bv_nr}} - {{payload.fach}}\nDESCRIPTION:Unterricht Mischok Academy\nCLASS:PUBLIC\nDTSTART:{{payload.beginn}}\nDTEND:{{payload.ende}}\nDTSTAMP:{{payload.beginn}}\nEND:VEVENT\nEND:VCALENDAR","output":"str","x":530,"y":160,"wires":[["9aa697e2f1262f10"]]},{"id":"9aa697e2f1262f10","type":"function","z":"4b960cd753d1354f","name":"","func":"msg.topic = \"Subject\"\nmsg.filename = \"abc.txt\"\nmsg.description = \"Inhalt der Email\"\nmsg.to = \"bernhard.lang@symbionix.de\"\n//msg.icalEvent = \"{filename: 'invitation.ics'. method: 'request', content: msg.payload}\"\nmsg.icalEvent = msg.payload\nmsg.payload = \"payload\"\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":700,"y":160,"wires":[["2297a8b238f28c04"]]},{"id":"ae9094cde567aa54","type":"inject","z":"4b960cd753d1354f","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":"","topic":"","payload":"","payloadType":"date","x":360,"y":160,"wires":[["2e3a988436c958ee"]]},{"id":"2297a8b238f28c04","type":"e-mail","z":"4b960cd753d1354f","server":"mail.gmx.net","port":"465","secure":true,"tls":false,"name":"","dname":"","output":false,"outputs":0,"x":930,"y":200,"wires":[]}]

Thanks for any hints!!!

Your export only consists of an inject node.

oh sorry. wrong copy :wink:
I updated it now!

You are not using the node-red-node-email-variable node, just the noremal email node.

Did you install node-red-node-email-variable?

Edit: or...I don't have it installed...
interesting you can not install node-red-node-email-variable if node-red-node-email is installed. Did you uninstall node-red-node-email?

Hi,
yes i uninstalled node-red-node-email and installed the node-red-node-email-variable because of the icalEvent-property…

What version of node-red are you in?
What device are you running it on?

I'm on v2.2.2 on Heroku Cloud (web-Dynpro)
Update is not so easy ...

Ok, I just tried your flow on a Pi with version 2.2.2 and node-red-node-email-variable installed. When I try it I see a warnng in the debug panel:

Warning: msg properties can no longer override set node properties. See bit.ly/nr-override-msg-props

before seeing the

ReferenceError: icalEvent is not defined
    at EmailNode._inputCallback (/home/pi/.node-red/node_modules/node-red-node-email-variable/variable-email.js:196:25)
    at /usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:210:26
    at Object.trigger (/usr/lib/node_modules/node-red/node_modules/@node-red/util/lib/hooks.js:166:13)
    at EmailNode.Node._emitInput (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:202:11)
    at EmailNode.Node.emit (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:186:25)
    at EmailNode.Node.receive (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:485:10)
    at Immediate._onImmediate (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/flows/Flow.js:831:52)
    at processImmediate (internal/timers.js:464:21)

Seeing that this is a contribuited node, you need to contact the author and see if he will help you out.

To get his email address, on the device where NR is installed, open a CLI and enter:
npm owner ls node-red-node-email-variable
and that will give you his email address.

Thanks for your support and detailled explanation!
I'll try my luck at the author...

Parallel i will try to update my instance!

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.