Page 1 of 1

[CODE] Send email/growl/etc notifications

Posted: 01 Jun 2012, 02:52
by rednoah
The easiest way to send notifications, e.g. about renamed/moved files, is to call external programs.

sendmail for sending email
growlnotify to sending growl notifications
eventcreate for creating windows event log entries
...

e.g. using an external program to send email:

Code: Select all

def paths = rename(...)
paths.each {
	def msg = "${it.name} has been added to the library"
	execute("sendemail.exe", "-f", "FROM EMAIL ADDRESS", "-t", "TO EMAIL ADDRESS", "-s", "SMTP SERVER:PORT", "-xu", "SMTP USERNAME", "-xp", "SMTP PASSWORD", "-u", msg, "-m", msg)
}