Custom script for a workflow to send an email notification on a custom doctype

Hie everyone, need assistance on how to write a custom script for a workflow to send an email notification from a custom doctype which i created.