Based on your requirement to send an e-mail on record creation, I don't see where the record editing takes place.
Though if you do want to edit the record just before it is created, you can use beforeSubmit(type)
in a User Event script and have it run when type == "create"
.
Otherwise if no editing is needed, afterSubmit(type)
in a User Event script and have it run when type == "create"
should work just as well.