I have an example bot created using FormFlow:
public static IForm<SandwichOrder> BuildForm()
{
OnCompletionAsyncDelegate<SandwichOrder> processOrder = async (context, state) =>
{
await context.PostAsync("We are currently processing your sandwich. We will message you the status.");
};
return new FormBuilder<SandwichOrder>()
.Message("Welcome to the sandwich order bot!")
.Field(nameof(Sandwich))
.Field(nameof(Length))
.Field(nameof(Bread))
.Field(nameof(Cheese))
.AddRemainingFields()
.Message("Thanks for ordering a sandwich!")
.OnCompletion(processOrder)
.Build();
}
On completion of form, the control comes at:
OnCompletionAsyncDelegate<SandwichOrder> processOrder = async (context, state) =>
{
await context.PostAsync("We are currently processing your sandwich. We will message you the status.");
};
I want to send an email to myself with all the form fields. How can I connect with SMTP and write an email function to send an email with all selected options and inputs from user?