Deluge function to compose email and associate to a record

Deluge function to compose email and associate to a record

Hi,
I successfully wrote a deluge function that sends emails with attachments, using built-in fields "primary" and "secondary" emails of a custom module.
As I need to keep track of sent email, I would like to know if it is possible with a deluge function:
- compose email
- save as draft or schedule (optional)
- associate to a record of a custom module (mandatory)

Thank you in advance for your help.

Best Regards,