/// <summary> /// Generates an action URL. /// </summary> /// <param name="context">The <see cref="ActionActivityContext" /> to associate with this activity and execution.</param> /// <param name="options"></param> /// <returns></returns> private string GenerateUrl(ActionActivityContext context, Options options) { var service = context.Resolve <IActionLinkService>(); var uriParams = new List <UriParameter> { new UriParameter( ResourceKeys.ActionParamName, service.UrlTokenEncode(new ActionLink(context.RootAction.Id, context.Contact?.Id, context.Event.CustomUri))) }; if (context.IsAuthenticated) { uriParams.Add(new UriParameter(ResourceKeys.ContactTokenParamName, AuthUtility.Protect(context.AuthTicket))); } return(UriUtility.MakeUri(options.Url, UriKind.Absolute, uriParams.ToArray())); }
/// <summary> /// Composes a new mail message from DB data. /// </summary> /// <param name="mail">The DB message to convert to a mail message.</param> /// <returns> /// The mail message. /// </returns> protected virtual MailMessage ComposeMessage(MailAddressItem to, CommandItem command, string returnUrl) { var routeLink = string.Join("/", RouteLink, command.Uri); var commitLink = UriUtility.MakeUri(routeLink, UriKind.Absolute, new UriParameter("returnurl", returnUrl)); var rollbackLink = UriUtility.MakeUri(routeLink, UriKind.Absolute, new UriParameter("rollback", "true"), new UriParameter("returnurl", returnUrl)); var message = new MailMessage { SubjectEncoding = Encoding.UTF8, Subject = command.Line, BodyEncoding = Encoding.UTF8, Body = string.Format(HtmlBody, commitLink, rollbackLink), IsBodyHtml = true }; message.To.Add(new MailAddress(to.Address, to.Name, Encoding.UTF8)); return(message); }