how to share a link via sms in blackberry - blackberry

I am building an application where I need the option to share via email and SMS.
I have done the share via Email, where when the user selects the image, the url is passed as the content of the email. But while sharing via SMS, I can't do something like setContent as I did for email and fetch the url in the SMS directly, instead of user typing the address manually.
I am using Message class in email and MessageConnection class for SMS, as shown in the blackberry community example.

The Message object you receive when calling MessageConnection.newMessage(TEXT_MESSAGE) is actually a TextMessage object (or a BinaryMessage object with BINARY_MESSAGE).
If you cast the received object to the proper class (TextMessage or BinaryMessage), you should be able to use its setPayloadText(String data) (or setPayloadData(byte[] data) for a BinaryMessage) to enter a value in the message before sending it.
Your code should look like this:
Message msg = myMessageConnection.newMessage(TEXT_MESSAGE, /* address */);
TextMessage txtMsg = (TextMessage)msg;
txtMsg.setPayloadText(/* Text to send */);
myMessageConnection.send(msg);

When you send an email, you can set the body of it and send it to the user from the Email native application. You cant do taht for SMSs. I worked on that issue and for BB Torch I was able to set the text of the SMS message but for other devices that was impossible. I always obtain an empty text message!!
So y suggestion to you is using the following code wich will send the SMS to a number without the interference of the user
MessageConnection conn = (MessageConnection) Connector.open("sms://" + userNumber);
TextMessage txtmessage = (TextMessage) conn.newMessage(MessageConnection.TEXT_MESSAGE);
txtmessage.setPayloadText(text);
conn.send(txtmessage);

Related

Add buttons in whatsapp message response twilio

I currently have the following code which successfully replies any message I send with "Ola":
#app.route("/bot", methods=["POST"])
def bot():
incoming_msg = request.values.get('Body', '').lower()
resp = MessagingResponse()
msg = resp.message()
quote = 'Ola'
msg.body(quote)
return str(resp)
I would like to have response buttons to my reply. Please see attached image, I'd like to add the "Got it" button with my message text. Is that possible for python. Thanks.
To send quick reply or call to action buttons over WhatsApp using Twilio, you need to create a template and add the buttons to the template. To trigger the template, you need to send a message containing the text of the template in the body. This is all covered in more detail in the Twilio documentation on using buttons in WhatsApp.
Note, you need to have a working WhatsApp number in your account to create and send templates. You cannot use the Sandbox to test out this feature.

Docusign iOS SDK directly sending envelope without opening anything also not asking to do the signature

I have created a template in docusign web and using its template id, i am calling the function from iOS SDK.
TemplatesManager.sharedInstance.displayTemplateForSignature(templateId: templateId, controller: self, tabData: tabData, recipientData: recipientData, customFields:customFields, onlineSign: onlineSign, attachmentUrl: attachmentUrl) { (controller, errMsg) in
print(errMsg)
}
The recipient data i am sending is
let recipientDatum = DSMRecipientDefault()
// Use recipient roleName (other option to use recipient-id) to find unique recipient in the template
recipientDatum.recipientRoleName = "Client"
recipientDatum.recipientSelectorType = .recipientRoleName
recipientDatum.recipientType = .inPersonSigner
// In-person-signer name
recipientDatum.inPersonSignerName = "Akshay Somkuwar"
// Host name (must match the name on the account) and email
recipientDatum.recipientName = "Akshay Somkuwar"
recipientDatum.recipientEmail = "akshay.s.somkuwar#gmail.com"
let recipientData: Array = [recipientDatum]
Same recipient is added for template in docusign website
Also i have added observers for DSMSigningCompleted and DSMSigningCancelled to get envelopeId.
Now when i am calling this function displayTemplateForSignature no screen is opening to show the PDF or To sign the PDF, without asking for signature, the envelope is directly sent to the recipient. and i am getting this response in console with notification.
name = DSMSigningCompletedNotification, object = Optional(<Public_Adjuster.AgreementSignViewController: 0x110bb8060>), userInfo = Optional([AnyHashable("templateId"): 506346f5-7adb-4132-b15f-d288aa268398, AnyHashable("signingMode"): online, AnyHashable("envelopeId"): 2eeeeda8-5b74-4930-904e-94b2ce6451ac])
I want to open the pdf for the passed templateId but its not opening the pdf nor its asking for signature, and its directly sent to the recipient.
Any help will be appreciated, Thank you.
This behaviour, sending the envelope directly, is triggered when DocuSign SDK can not find any signers in the template/envelope that matches the logged-in user. Given that you are using the recipientDefaults, ensure that your signer information on the template (preset signer on the DocuSign web) matches the Account information exactly with the recipientDefaults object.
You may compare it with .
One issue I noticed is the signer type is set to need to sign which corresponds to a remoteSigner on the DocuSign web. And on the recipientDefaults object it's set as inPersonSigner. It should be .signer corresponding to DSMRecipientTypeSigner.
recipientDatum.recipientType = .signer.
Or you may change the need to sign to in person signer on the DocuSign web.
Another suggestion is to remove the name & email from the template screenshot shared and keep that empty as the client app is passing name & email with the recipientDefaults object to the SDK.
More details: How to set recipient defaults

Office365 API append email signatures based on senders email address

We are considering using Office365 API to send our emails. One reason we are considering Office365 is to be able to automatically apply signatures. So if we send automated email for a specific user, are we able to specify that we want the signature appended to that email?
Would we be required to use the user credentials for the user we are sending with, or are there Admin roles available allowing use to pick / automatically apply the correct email signature?
Thanks,
AFAIK, you can't choose/apply different signature when sending email to specific user with O365 API. As a workaround, with outlook mail rest api ,you could create an email message , inserts an email signature into the end of email message body when sending to a specific user. You could use a HTML body for your email message,for example :
// Create the email message text body.
string htmlBodyTxt = #"<html><head></head><body><p>This is the email message body before a signature is added.</p>
</body></html>";
// Identify the signature insertion point at the end of the HTML body.
int signatureInsertPnt = htmlBodyTxt.IndexOf("</body>");
// Create the email signature.
string signature = "<p>Dallas Durkin<br/>Senior Planner<br/>Adventure Works Cycles</p>" +
"<p>4567 Main St.<br/>La Habra Heights, CA 90631</p><p>(323) 555-0100</p>";
// Insert the signature into the HTML body.
string newBody = htmlBodyTxt.Insert(signatureInsertPnt, signature);

Send an email from my app without using MFMailComposeViewController

Is it possible to send an automatically generated email using my own email address to another email address of mine by clicking a button?
I tried to use MFMailComposeViewController but another view appeared. Can I do it without this view?
You can do it only by creating own server-side mailer. On button clicking you have to send request with all needed data (email address, body, subject, etc) and server will send mail.
If You want send directly from app - MFMailComposeViewController is the only LEGAL way
By default in iOS you can only use the MFMailComposeViewController, which uses the user's mail account. Therefore you cannot send fully automated mail messages (the user allways has to confirm/cancel).
libMailCore is a great iOS framework which allows you to generate and send mails without any user interferance. In that case you'll be using your own server/credentials (thus not the user mail account). There are apps in the App Store using mailcore, so i would guess it's legit.
Yes there is a way using Swift-SMTP.
Send email
Create a Mail object and use your SMTP handle to send it. To set the sender and receiver of an email, use the User struct:
let drLight = Mail.User(name: "Dr. Light", email: "drlight#gmail.com")
let megaman = Mail.User(name: "Megaman", email: "megaman#gmail.com")
let mail = Mail(
from: drLight,
to: [megaman],
subject: "Humans and robots living together in harmony and equality.",
text: "That was my ultimate wish."
)
smtp.send(mail) { (error) in
if let error = error {
print(error)
}
}

How to know the current state of application invoked in blackberry?

Is it possible to know the state of application invoked in blackberry? For example, if we invoke blackberry email application after sending an email, can we know if the application has closed or still running and also where the email has been sent, the subject, the content, etc.? The code may be something like this:
try {
Message message = new Message();
Address address = new Address("email#yahoo.com", "Email");
Address[] addresses = {address};
message.addRecipients(RecipientType.TO, addresses);
message.setContent("Testing email from MyTabViewDemo application");
message.setSubject("Testing Email");
Invoke.invokeApplication(Invoke.APP_TYPE_MESSAGES, new MessageArguments(message));
log.debug(MyApp.GUID_LOG, "Send email action done!");
} catch (Exception e) {
Dialog.inform(e.toString());
}
and how about retrieving the state of other applications like phone, sms, camera?
Thank you.
You can view the visible applications by calling
ApplicationManager.getApplicationManager().getVisibleApplications();
That returns an array of application descriptors. From a descriptor, you can know the names and ids.
It is possible, however, that the messaging app is always on background and cannot be closed (I'm not 100% sure here)
But you can't know if a message has ben sent or not sending the mail like that.

Resources