Skip to main content

Event Hooks

Posted by moshe on Thu, 11/04/2010

HI

does anyone have a running hook that could send a email, with full info like after tenant creation it should send a email that a new tenant named ${TENANT} hes been created

i have been trying the following but with no luck

#!/bin/bash
# script to send simple email
# email subject
SUBJECT="New Extension has been created"
# Email To ?
EMAIL="admin@voore.com"
# Email text/message
EMAILMESSAGE="/hadata/mail.txt"
echo "Hi Admin"> $EMAILMESSAGE
echo "This is an automated email to let you know that ${EXTENSION} under $TENANT has been created"> $EMAILMESSAGE
echo "" >>$EMAILMESSAGE
echo "" >>$EMAILMESSAGE
echo "please update the billing records" >>$EMAILMESSAGE
# send an email using /bin/mail
/bin/mail -s "$SUBJECT" "$EMAIL" < $EMAILMESSAGE

any help would be appreciated


Submitted by eeman on Fri, 11/05/2010 Permalink

its because you're using bogus variables...

to get a list of every variable available to your script put the command printenv in your script to mail you a list of every variable.. you can find what the name of the variable you are looking for that shows the tenant name that got added.

Submitted by eeman on Mon, 11/08/2010 Permalink

to get a list of every variable available to your script put the command printenv in your script to mail you a list of every variable


#!/bin/bash
# script to send simple email
# email subject
SUBJECT="VARS"
# Email To ?
EMAIL="admin@voore.com"
# Email text/message
EMAILMESSAGE="/hadata/mail.txt"
VARS=`printenv`
echo $VARS > $EMAILMESSAGE
# send an email using /bin/mail
/bin/mail -s "$SUBJECT" "$EMAIL" < $EMAILMESSAGE

Submitted by hmelgers on Thu, 03/17/2011 Permalink

could we have the mac address there too (in case of extension create/modify) ?

Looks like provisioning in TL is only supported in dhcp mode. We use provisioning via separate https for linksys phones and it would be nice to make/modify an entry there via the event hook .

Hans