@kahn-hubitat I just tested this in my app and it works. Message sent would be:
{Subject:Email Subject , Message:Email body, To:name@example.com}
Only difference is my Gmail notification won't accept a From since that is defaulted by the API.
I tried to convert the string to a JSON object but ran into issues since it would require quotes around the key and value so came up with a different method. Hopefully this works in your app:
That's not gonna work for me as i said it would break all existing stuff to have the closing bracket at the end and the message inside.
Also would break messages with commas in them which is why i.didnt use.split. i could modify it to isolate the begin and end bracket leaving the message after it and then call your code.
ya already had this code to parse the subject out of straight xml.. weird. so brackets are not going to work or it will break anyone using this feature.. must have added it for a reason.
v 4.92
the original header replacement above still works
but added an alternative message based on ritchierich pseudo xml at the start of the message
ie
{header: value, header: value}, this is the message
or
{header: value, header: value. Message: this is the message}
both work.
Legal header values for replacement are: Subject: From: To: CC: Message:
order is not important.
example:
{Subject: new subject, CC:kahn-zzspam@lgk.com, Message:newmessage here,To: kahn-saved@lgk.com, From: kahn@lgk.com}, this is a test
or
{Subject: new subject, CC:kahn-zzspam@lgk.com, Message:newmessage here,To: kahn-saved@lgk.com, From: kahn@lgk.com}
caveat: just notice if you use the message: replacement option the message itself cannot have a colon : in it or it will truncate past the colon.
Not really sure I follow your use case but the stock Notifications app supports Global Variables to be included in the message as of v2.3.4 and Rule Machine does as well. So if the notification you are trying to send comes from one of those apps you can include the GV values within the notification as they get sent to the notification devices and from there to whatever device it is set to send it to Email vs Push vs SMS vs etc...
Thanks.. I ended up creating a webcore template to take care of associating gv's and applying them to the directives. Now I can just set them and call it from all my other instances.
Hi, I am looking to do SMTP notifications to an internal email server. There will be no need for authentication.
This is a very long thread going back several years so I was wondering if someone could point me to the correct spot to just install the latest version of the app and then the process for just sending over to a local email server. Thanks!
Easiest methos is to use Hubitat Package Manager and search for "sendmail" and install it from there. Otherwise list most community solutions the code links are in the very first post.
As noted, install it from Hubitat Package Manager.
The process/setup is documented above - you create a new device on the Device tab in HE, and then complete the setup of the parent,which then creates the child devices.
I got SendMail installed and got it connected to my email server. I was able to send test messages successfully but I had some questions. I got 6 test messages, I assume this is because there were 5 children and it was testing all of them? I won't get six messages each time, right?
After creating the Sendmail device, it had the parent device and 5 children (I left it at defaults). When i go into, for example, HSM for water alerts, I see "Sendmail Parent". So I would select this as the notification option, correct? What's the purpose of the child nodes?
And I can use this same Parent device for notifications for multiple different apps within Hubitat right? I am asking because I was reading over the forum and thought I saw somewhere that you had to create separate ones different apps but maybe I misread that.