Adds an invitation workflow to a resource
Generates an invitation resource that invites an email address to the
subject. An invitation is accepted, declined or revoked, and expires once
its expires_at passes. resend moves expires_at forward again. The
subject gains has_many :invitations and has_one :latest_invitation.
When the subject does not exist, it is created with mix ash.gen.resource
first.
Nobody may send an invitation until the application defines who may, in
the generated Checks.CanInvite module. Nobody may accept or decline
until the application defines how an actor proves they are the invitee,
in the generated Checks.CanAccept module.
Example
mix ash_workflow.gen.invitation MyApp.Teams.Team --invitee MyApp.Accounts.User --expires-after 7d
Options
--invitee- required. The actor resource. The inviter and the invitee who accepts belong to it.--expires-after- how long an invitation stays open after it is sent or resent, given as10s,30m,12h,2dor2w. Defaults to7d.--module- the invitation resource's module name. Defaults to the subject's name withInvitationappended.--domain- the domain for a subject the task creates. Required only when the subject does not exist.--transition-log- also generates a transition log for the invitation withmix ash_workflow.gen.transition_log. Defaults totrue.