Custom SiteWorx Client Mail

Hey all, continuing the unending fun that is the Event Hooks plugin, here’s a script to notify clients when their SiteWorx account has just been created. As always, expand upon it as needed!

Thanks!


#!/bin/bash
#
# INSTALLATION:
#
# Install this script at /usr/local/bin/notify_sw_client.sh
# 
# Enable the Event Hooks plugin in NodeWorx.
# Add the following line to your InterWorx Event Hook Configuration:
# 
#     Ctrl_Nodeworx_Siteworx add /usr/local/bin/notify_sw_client.sh
# 
# Ensure that both this file *and* the Event Hook config are both readable
# and executable by the iworx user:
# 
#     chmod 0770 /usr/local/bin/notify_sw_client.sh
#     chown iworx /usr/local/bin/notify_sw_client.sh

if [[ "$iw_master_domain" == "" ]]; then
  exit 1
fi

mail -s 'Welcome to SiteWorx!' $iw_email -- -f admin@example.com<<EOF
Hello! Your SiteWorx account for $iw_master_domain has just been created.

To login, visit https://$iw_master_domain:2443/siteworx

E-mail: $iw_email
Password: $iw_password
EOF

exit 0

Hi dragonmiller

Did you resolve your permissions issue stopping the hook from working.

If not and you don’t know how to, the easiest way is to ssh into the server and run the permission scripts but do not include the hash ie chown etc…

Also, the above hook maybe for version 5 interworx and if your on version 4, you need to replace the following

iw_master_domain with iw_domain

Otherwise you will have an abort of the hook

If you’ve resolved yourself, please ignore this.

Many thanks

John