Is there a way to send a http link in a wp8 app? I'm using
EmailComposeTask emailComposeTask = new EmailComposeTask();
but whenever I include an http link in the body of my email, it just appears as regular text.
My http link is included in a default string, so it would kind of make sense, but I assumed that the email app receving the email would just detected the http://... and automatically converted it a link but that's not the case.
Should I include the http link within a specific tag??
Any ideas?
Thanks
You Would see link as normal Text in Body when Composing but in mail it would be seen highlighted as link
Try this :
EmailComposeTask task = new EmailComposeTask();
task.To = "Set Email here";
task.Subject = "Subject goes here";
task.Body = "Your Mesage goes here \n http://www.google.com";
task.Show();
I have attached Screen Capture of inbox.
When you called EmailComposeTask, It will show an mail edit page.
In this page, the http link can't be shown.
But when you send it, in the Sent folder, the mail can show http link.
And in the receiver's Inbox, it also can be shown.
Related
I want to be able to create an envelope and then email the link to the signer. The code segment I came up with is:
EnvelopesApi envelopesApi = new EnvelopesApi();
envDef.Status = "sent";
EnvelopeSummary envelopeSummary = envelopesApi.CreateEnvelope(accountId, envDef);
RecipientViewRequest viewOptions = new RecipientViewRequest()
{
ReturnUrl = "https://www.docusign.com/devcenter",
ClientUserId = signer.ClientUserId,
AuthenticationMethod = "email",
UserName = signer.Name,
Email = signer.Email // does NOT send an email
};
ViewUrl recipientView = envelopesApi.CreateRecipientView(accountId, envelopeSummary.EnvelopeId, viewOptions);
The code before this segment gets the account, signer an envelope definition, etc.
This code works fine if I set envDef.Status = "sent". If I do not set that status, I get an exception from the last line of code in this segment.
I want to just have the envelope go into created status, then get the URL and send the email in my own code that does relay email.
Or, can I supply an email address and have Docusign send the email? But, in that case, what if their email fails for some reason?
The bottom line is that I want a way to deal with the problem of how to re-send the link if the email fails to get sent.
Re your stated objective:
I want to just have the envelope go into created status, then get the URL and send the email in my own code that does relay email.
This approach is not recommended, since the URL that you obtain via CreateRecipientView will timeout in a short amount of time (I believe it's 5 minutes). In other words, if the recipient does not open the email that you send them and click the link to launch their signing session within that period of time, the link becomes invalid and they'll be unable to use it to access their signing session.
Instead of using CreateRecipientView, I'd recommend that you simply specify the recipient's info (name, email, etc.) as part of the envelope definition and then DocuSign will send the recipient an email that contains a link that they can use to access their Envelope. This link will be valid for days (not minutes, like the link that you generate yourself via CreateRecipientView), so there's no requirement that the signer act on it immediately. If for some reason the recipient misplaces or does not receive the email that DocuSign sends them, you can easily have DocuSign re-send that email notification by either using the DocuSign web UI or by using the UpdateRecipient API operation with resendEnvelope=true specified (as Frederic described in his answer).
Update #1
There's no way to retrieve a long-lived link that a recipient can use to initiate their signing session. A common way to address your scenario would be the following:
Send the signer an email that contains a link that leads them to a web page that you build -- and instructions for them to click that link to launch their Envelope whenever they are ready to review/sign the document(s). (The link URL would need to contain some sort of querystring parameters that your web page could use to identify the Envelope and Recipient.)
Design your web page such that when it receives an inbound request (as it would when the recipient clicks the link in the email you send them), it uses the information in the querystring parameters to identify the Envelope and Recipient, then issues a CreateRecipientView request to retrieve the URL that will launch that recipient's signing session, and finally, automatically redirects the user to the URL that the CreateRecipientView response returns, thereby opening the Envelope for the recipient to review/sign/submit.
By following a process like this, you're able to craft/send the email that the recipient receives (instead of relying upon DocuSign to do so), and can ensure that you're only retrieving the envelope URL whenever the user has indicated that they're ready to sign (thereby avoiding the potential of the short-lived link expiring before it's used).
Update #2
For an example of how to add recipient(s) to the EnvelopeDefinition object using the DocuSign C# SDK, see this "recipe" -- specifically, see the code within the requestSignatureOnDocumentTest method. It's basically a two-step process:
1) Define each recipient. For example:
// Add a recipient to sign the documeent
Signer signer = new Signer();
signer.Email = recipientEmail;
signer.Name = recipientName;
signer.RecipientId = "1";
2) Populate the Recipients property of the EnvelopeDefinition object with the recipient(s) that you create. For example:
envDef.Recipients = new Recipients();
envDef.Recipients.Signers = new List<Signer>();
envDef.Recipients.Signers.Add(signer);
I'm going to try to answer both of your inquiries :
1) The bottom line is that I want a way to deal with the problem of how to re-send the link if the email fails to get sent.
In order to re-send the DocuSign email to your recipients, you can use the UpdateRecipient() method as such (see my C# example below). This will re-trigger the signing email to be sent one more time to the transaction recipients :
RecipientsUpdateSummary recipientsUpdateSummary =
envelopeApi.UpdateRecipients(
accountId,
envelope.EnvelopeId,
envelope.Recipients,
new EnvelopesApi.UpdateRecipientsOptions { resendEnvelope = "true" });
Here is what the official documentation states :
2) Is there a way to create an envelope in the 'created' state and then put it into 'sent' later?
Yes, it is possible.
When you create your envelope, make sure to specify the "Created" status as below :
Status = "created"
Create your envelope :
envelopeApi.CreateEnvelope(accountId, envelope);
Then, when you're ready, change the envelope status to "sent". This will trigger the emails to the recipients. Voila !
Envelope updatedEnvelope = new Envelope
{
Status = "sent"
};
envelopeApi.Update(
accountId,
envelopeId,
updatedEnvelope);
I have textbox which shows the content of mail body.
While forwarding mail original mail body if content is edited by pressing any key then user id should get appended. Please let me know how should I do this in WPF.
Before sending the mail
if(edits_made) // bool value which indicates if changes have been made
{
yourtextbox.Text.Insert(0, userid);
}
Not before sending an mail.
Similar functionality is there in outlook as well.
Add < prefix to original mail if content is modified.
Same I am trying to build in WPF.
Introdution
I am currently working a system develop with C#.
The system is about request approval.
When a request made, system will send email to user ask for response.
User's response will as simple as approve, reject or request update.
Question/Problem
Is it possible to have a button (approve or reject) in email content which allow user to response to system with only one click but without open browser?
Or, Is it possible to create button in email content which enable user to click to create new email with pre-set subject and recipient like following:
subject: request id - 123 - action - approve
to: response#system.com
as response email for user to send.
Then system can then recognize the email received and perform required back-end process.
Research Done
Research 1
What I currently found was outlook appointment email.
it done like second solution create new email with content for user send a response.
But, it only have options accept, decline and tentative.
And, I am not sure is blackberry support it like outlook.
The following is the blog found to create appointment email:
http://chuckdotnet.blogspot.my/2007/10/send-outlook-meeting-requests-with.html
Research 2
The following website teach you how to create hyperlink in email content which can create new email with pre-populate subject, body, and recipient
https://community.articulate.com/discussions/building-better-courses/hyperlink-to-create-an-already-written-email
However, No test had perform in blackberry yet.
Appreciate for any suggestion from you guys and I willing to try.
Is it possible to sent an email with button which can click to create
email with some pre-set content?
Yes, this is possible, see the System.Net.Mail code in the .NET framework.
https://msdn.microsoft.com/en-us/library/system.net.mail(v=vs.110).aspx
You can also see this StackOverflow question about how this is used.
Send e-mail via SMTP using C#
MailMessage mail = new MailMessage("you#yourcompany.com", "user#hotmail.com");
SmtpClient client = new SmtpClient();
client.Port = 25;
client.DeliveryMethod = SmtpDeliveryMethod.Network;
client.UseDefaultCredentials = false;
client.Host = "smtp.google.com";
mail.Subject = "this is a test email.";
mail.Body = "this is my test email body";
client.Send(mail);
Finally, your code should fire a serverside post on button click to have the server take care of sending the email. If data needs to be posted to the server, you may want to consider putting this data in a form input, which will post to your controller. You can then take that data and build the email with the example I provided in the links.
In an ASP.NET MVC5 C# application I am using the standard code for sending confirmation emails when a user registers, something I've done in multiple projects:
var callbackUrl = Url.Action("ConfirmEmail", "Account", new { userId = user.Id, code = code }, protocol: Request.Url.Scheme);
await UserManager.SendEmailAsync(user.Id, "Confirm your account", "Please confirm your account by clicking here");
Normally when the recipient receives the email, it's content-type is text/html. However, in this one application, the emails arrive with content-type text/plain and the content is not rendered as html, it is rendered as plain text. It should like this:
Please confirm your account by clicking here
But it looks like this:
Please confirm your account by clicking here
I searched the docs but cannot find any information that indicates why this would be or indeed how to change this behavior.
I also updated to the latest version of the Microsoft ASP.NET Identity Core (2.2.1) thinking that might help, but it didn't have any effect on the issue.
I also tested sending from a Google Apps email account for a different organization (which I use for other apps with this exact same code to send this confirmation email and know it sends as html) in case there are some settings in there that matter.
Any ideas on why it sends as text/plain and how I can fix this?
Thanks!
The problem more than likely isn't with your Identity, it is probably just with the mail function itself. Have you set the MailMessage.IsBodyHtml property to true?
MailMessage message = new MailMessage(fromEmail, toEmail, subject, body);
message.IsBodyHtml = true; // here
This will set the body of the email to be rendered as HTML. By default, the property is false, so you need to explicitly declare it to be true.
The issue is likely with the mail service/api you're using. I have used several and they generally have either an optional htmlBody parameter or an isBodyHtml parameter. If you specify which one you're using, or provide the code for the SendAsync Methos in the EmailService class (in IdentityConfig.cs), it'll probably be easy to point you in the right direction.
If your stuck with plain text, you can send plain text with a url and the client will often convert it into a link for the user. Outlook and gmail do this.
So, it would look like this instead:
await UserManager.SendEmailAsync(user.Id, "Confirm your account", "Please confirm your account:" + callbackUrl);
You can use SendGrid API to send HTML type emails and they also provide transactional templates.
Links
https://sendgrid.com/
Even advised in the Asp.net core doc
https://learn.microsoft.com/en-us/aspnet/core/security/authentication/accconfirm?view=aspnetcore-2.2&tabs=visual-studio
I am sending an email with System.Net.Mail and I want to protect my user from receiving urls through those emails.
I have already used HtmlEncode and it works if my form data is html or script but if the user types a normal url (e.g. www.stackoverflow.com) or an email address, the e-mail body itself creates a link - even though I set IsBodyHtml to false.
I would like to know how I could ensure that my entire email body text cannot be clicked and taken somewhere else.
Ps: I tried using UrlEncode but it 'breaks' the entire email message.
This is caused by the email client (Outlook, Gmail, etc.) parsing the URL for your convenience. If you look inside the Body property of the MailMessage object, you would have no HTML link (<a href=...).