D
Dan Sinclair
Hi Guys,
I'm very new to Ruby, so please bare with me!
I'm trying to make a ruby script that runs a command/executable. The
command/executable is native to Mac OS X 10.5 and 10.6. It's the
sendmail command (found in /usr/sbin/sendmail). The script I have so far
is this:
###################################
when "email"
begin
job_media = ENV['job_media']
job_reason = ENV['JOB_REASON']
e_address = get_node_value('post-action-e-address')
eeemail(job_media, job_reason, e_address)
end
###################################
def eeemail(job_media, job_reason, e_address)
RECIPIENT = (e-mail address removed)
MEDIA = blah
REASON = job_reason
SUBJECT = "Engine Admin - Job #{REASON}"
exec("/usr/sbin/./sendmail #{RECIPIENT} << EOF
From: "Episode Engine" <[email protected]>
Subject: "#{SUBJECT}"
"Job #{MEDIA} has #{REASON}"
EOF")
end
###################################
This script will run when a piece of software my company sell, finishes
a task. The main thing I'm not getting to work is the:
exec("/usr/sbin/./sendmail #{RECIPIENT} << EOF
From: "Episode Engine" <[email protected]>
Subject: "#{SUBJECT}"
"Job #{MEDIA} has #{REASON}"
EOF")
Any ideas will be greatly appreciated.
Regards,
Dan
I'm very new to Ruby, so please bare with me!
I'm trying to make a ruby script that runs a command/executable. The
command/executable is native to Mac OS X 10.5 and 10.6. It's the
sendmail command (found in /usr/sbin/sendmail). The script I have so far
is this:
###################################
when "email"
begin
job_media = ENV['job_media']
job_reason = ENV['JOB_REASON']
e_address = get_node_value('post-action-e-address')
eeemail(job_media, job_reason, e_address)
end
###################################
def eeemail(job_media, job_reason, e_address)
RECIPIENT = (e-mail address removed)
MEDIA = blah
REASON = job_reason
SUBJECT = "Engine Admin - Job #{REASON}"
exec("/usr/sbin/./sendmail #{RECIPIENT} << EOF
From: "Episode Engine" <[email protected]>
Subject: "#{SUBJECT}"
"Job #{MEDIA} has #{REASON}"
EOF")
end
###################################
This script will run when a piece of software my company sell, finishes
a task. The main thing I'm not getting to work is the:
exec("/usr/sbin/./sendmail #{RECIPIENT} << EOF
From: "Episode Engine" <[email protected]>
Subject: "#{SUBJECT}"
"Job #{MEDIA} has #{REASON}"
EOF")
Any ideas will be greatly appreciated.
Regards,
Dan