I have WCM setup on a local PC, but I'm not skilled at coding to work out the command(s) needed to get an email notification.
If I want an alert from my Gmail or Yahoo account, do I need to enable anything in my webmail account? What is the specific command that I need to use for the 'Issue command on update'?
I'd like to run WCM on a home server that is always-on, so I can be notified by email even when my PC is off.
Thank you all for your help.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am using mailsend-go on Windows ( https://github.com/muquit/mailsend-go/ ) and have crafted a batch file (WebChangeMonitor_Mail.bat) like this (you'll need to adopt it to your Email server settings):
Then, I setup the command to issue on update in the item settings like this: [PATH_TO_WEBMON]\WebChangeMonitor_Mail.bat %addr "%desc" %chk "%res" %guid %crc
Hope that helps!
Last edit: Morten MacFly 2022-01-30
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
FYI - Not sure if something has changed on mailsend-go but I had to eliminate the hyphen before the "auth" operator and change "-M" to "-msg" for this to work. Thanks for all of this, great program!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I installed mailsend-go and wrote the above batch file (I needed to change a couple of items and is called mailsend.bat) and the batch file is in my path. If I run the batch file it sends an email with "Address: , Description: , Check: , Result: , GUID: , CRC: " in the message area. I set up a new Tool named Email2 which is "mail.bat %addr "%desc" %chk "%res" %guid %crc". In Alert/log I chose Email2 as default command.
When I check a web page that has changed a notification comes up saying item is updated but NO email.
What have I done wrong?
Thanks
Chris
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Is that true? In that case you should rename the tool to mailsend.bat
You can also provide the full path to the tool, btw, just to make sure you run the right thing...
Are there any messages in the log wrt running the tool?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
Anonymous
-
2022-09-09
Thank you. I had made a mistake. it's now working.
Can I get the email to show the text differences?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
Anonymous
-
2022-09-10
You can, but you need an external "Diff-Tool" for that purpose. Usually each Diff-Tool has a command line interface to compare two files and write a report into another file.
Before you send the email, you can run such a Diff-Tool reporting and attach the report file to the email. You get access to the previous and updated content through the GUID:
The old file is: {Your_Temp_Folder_As_Setup_in_WCM}\%GUID%.old
The new file is: {Your_Temp_Folder_As_Setup_in_WCM}\%GUID%.new
The Diff-Command could look like (pseudo notation): {Diff-Tool} -left {OLD_FILE} -right {NEW_FILE} -report {REPORT_FILE}
...then attach the file to the Email (see command above).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks. I had made a mistake and now the emails work. I am getting a reply like
"Address: xxxx.com, Description: xxxx.com, Check: 2022-09-09, Result: 17:51:07, GUID: OK, CRC: D5A19F14-B9B4365E-94453612-B806636F"
Is there a way that the actual text changes are shown?
Chris
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I was about to try the commands above and now WCM seems to have problems with file locations on startup and when shutting down. I cannot see what I have done. I tried uninstalling and reinstalling the program as well as downgrading to 22.07
Would you be able to indicate what is wrong and how to fix it?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
Anonymous
-
2022-09-14
You can setup the folder for temporary files under:
Tools > Configuration -> Files/Folders
The first item.
Make sure its not set to "Portable" if the directory you installed WCM into has no write access (which is the case for the standard installation folder under C:\Program files or alike).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have WCM setup on a local PC, but I'm not skilled at coding to work out the command(s) needed to get an email notification.
If I want an alert from my Gmail or Yahoo account, do I need to enable anything in my webmail account? What is the specific command that I need to use for the 'Issue command on update'?
I'd like to run WCM on a home server that is always-on, so I can be notified by email even when my PC is off.
Thank you all for your help.
You would have to have WCM call a script to send the notification, such as PowerShell:
https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/send-mailmessage?view=powershell-7.1
I am using mailsend-go on Windows ( https://github.com/muquit/mailsend-go/ ) and have crafted a batch file (
WebChangeMonitor_Mail.bat
) like this (you'll need to adopt it to your Email server settings):Then, I setup the command to issue on update in the item settings like this:
[PATH_TO_WEBMON]\WebChangeMonitor_Mail.bat %addr "%desc" %chk "%res" %guid %crc
Hope that helps!
Last edit: Morten MacFly 2022-01-30
FYI - Not sure if something has changed on mailsend-go but I had to eliminate the hyphen before the "auth" operator and change "-M" to "-msg" for this to work. Thanks for all of this, great program!
I installed mailsend-go and wrote the above batch file (I needed to change a couple of items and is called mailsend.bat) and the batch file is in my path. If I run the batch file it sends an email with "Address: , Description: , Check: , Result: , GUID: , CRC: " in the message area. I set up a new Tool named Email2 which is "mail.bat %addr "%desc" %chk "%res" %guid %crc". In Alert/log I chose Email2 as default command.
When I check a web page that has changed a notification comes up saying item is updated but NO email.
What have I done wrong?
Thanks
Chris
Is that true? In that case you should rename the tool to
mailsend.bat
You can also provide the full path to the tool, btw, just to make sure you run the right thing...
Are there any messages in the log wrt running the tool?
Thank you. I had made a mistake. it's now working.
Can I get the email to show the text differences?
You can, but you need an external "Diff-Tool" for that purpose. Usually each Diff-Tool has a command line interface to compare two files and write a report into another file.
Before you send the email, you can run such a Diff-Tool reporting and attach the report file to the email. You get access to the previous and updated content through the GUID:
{Your_Temp_Folder_As_Setup_in_WCM}\%GUID%.old
{Your_Temp_Folder_As_Setup_in_WCM}\%GUID%.new
The Diff-Command could look like (pseudo notation):
{Diff-Tool} -left {OLD_FILE} -right {NEW_FILE} -report {REPORT_FILE}
...then attach the file to the Email (see command above).
Thanks. I had made a mistake and now the emails work. I am getting a reply like
"Address: xxxx.com, Description: xxxx.com, Check: 2022-09-09, Result: 17:51:07, GUID: OK, CRC: D5A19F14-B9B4365E-94453612-B806636F"
Is there a way that the actual text changes are shown?
Chris
Sure, you just need to adopt the Email command from above as needed. The message arises from this line:
set MAIL_MSG_STR=Address: %1, Description: %2, Check: %3, Result: %4, GUID: %5, CRC: %6
...you can change that to anything that is more useful to you.
I was about to try the commands above and now WCM seems to have problems with file locations on startup and when shutting down. I cannot see what I have done. I tried uninstalling and reinstalling the program as well as downgrading to 22.07
Would you be able to indicate what is wrong and how to fix it?
Thanks
Last edit: Chris Harris 2022-09-11
You can setup the folder for temporary files under:
Tools > Configuration -> Files/Folders
The first item.
Make sure its not set to "Portable" if the directory you installed WCM into has no write access (which is the case for the standard installation folder under C:\Program files or alike).