Want to make a button that controls a function in zoho - zoho

I want to create an automated email in Zoho Cliq that sends a message to everyone every morning. In the message there is a button that should call the sendMsg function.
How can I define the sendMsg function?
The idea is that by pressing the button another message should be sent back to me.
Thanks for the help
response = map();
response.put("text","Wie startest du heute in deinen Tag?");
card = map();
card.put("title","Guten Morgen ☕");
response.put("card",card);
buttonsList = list();
buttonsList0 = map();
buttonsList0.put("label","Remote");
buttonsList0.put("type","+");
action = map();
action.put("type","invoke.function");
data = map();
data.put("name","sendMsg");
action.put("data",data);
buttonsList0.put("action",action);
buttonsList.add(buttonsList0);
response.put("buttons",buttonsList);

Related

How to define a custom function in deluge?

I want to create an automated email in Zoho Cliq that sends a message to everyone every morning. In the message there is a button that should call the sendMsg function.
How can I define the sendMsg function?
The idea is that by pressing the button another message should be sent back to me.
Thanks for the help
response = map();
response.put("text","Wie startest du heute in deinen Tag?");
card = map();
card.put("title","Guten Morgen ☕");
response.put("card",card);
buttonsList = list();
buttonsList0 = map();
buttonsList0.put("label","Remote");
buttonsList0.put("type","+");
action = map();
action.put("type","invoke.function");
data = map();
data.put("name","sendMsg");
action.put("data",data);
buttonsList0.put("action",action);
buttonsList.add(buttonsList0);
response.put("buttons",buttonsList);
Well, to define a custom function, you need to start with the "function" keyword, followed by the name of the function and its parameters enclosed in parentheses.
For example:
function my_function(input1, input2) {
}

Create a group chat using proactive message bot framework

I'm working on a adaptive card and having a button on card which is a choice card as show card, on click of submit of that choice card i want to start a group chat with the select users.
I'm trying to do it using proactive message for group chat but didnt got any internet ref for the code using c#.
Can anyone suggest some ref for that.
var conversationParameters = new ConversationParameters
{
IsGroup = true,
Members = new ChannelAccount[] { channelAccount1, channelAccount2, activity.Recipient, activity.From },
Activity = (Activity)message
};
var identity = new MicrosoftAppCredentials(MicrosoftAppId, MicrosoftAppPassword);
MicrosoftAppCredentials.TrustServiceUrl(activity.ServiceUrl);
var connectorClient = new ConnectorClient(new Uri(activity.ServiceUrl), identity);
ConversationResourceResponse CreateConversationResponse = await connectorClient.Conversations.CreateConversationAsync(conversationParameters);
I'm getting bad request error

Teams bot: Updated message with a Card not properly displayed until chat is refreshed

I have a Teams bot running with node js. I can response with a Text message or a Card to an incoming message, and I can update a previously sent message with a new Text Message.
But I have a problem when I update a message with a Card. It is not displayed properly, I see this in the chat:
<URIObject type="SWIFT.1" url_thumbnail="https://urlp.asm.skype.com/v1/url/content?url=https://neu1-urlp.secure.skypeassets.com/static/card-128x128.png">Card - access it on https://go.skype.com/cards.unsupported. <Title>Card</Title><Swift b64="eyJhdHRhY2htZW50cyI6W3siY29udGVudCI6eyJ0aXRsZSI6IkNvbm5lY3QgdG8gVGVzdEFwcDEiLCJ0ZXh0IjoiQ2xpY2sgU2lnbiBJbiBidXR0b24gdG8gY29ubmVjdCB5b3VyIFRlYW1zIGFjY291bnQgd2l0aCB5b3VyIFRlc3RBcHAxIGFjY291bnQiLCJpbWFnZXMiOlt7InVybCI6Imh0dHBzOi8vZXUtYXBpLmFzbS5za3lwZS5jb20vdjEvb2JqZWN0cy8wLXdldS1kOC01YTRhNjEzMjgyYzBhODRjY2JkYTFlNmVjNjcxYTY3Mi92aWV3cy9pbWdfcHJldmlldyJ9XSwiYnV0dG9ucyI6W3sidHlwZSI6Im9wZW5VcmwiLCJ0aXRsZSI6IlNpZ24gSW4iLCJ2YWx1ZSI6Imh0dHBzOi8vd3d3Lmdvb2dsZS5jb20ifV19LCJjb250ZW50VHlwZSI6ImFwcGxpY2F0aW9uL3ZuZC5taWNyb3NvZnQuY2FyZC5oZXJvIn1dLCJ0eXBlIjoibWVzc2FnZS9jYXJkIn0="><Description></Description></Swift></URIObject>
But If I change the chat/channel and go back, it is properly displayed.
It happens the same in a private chat with the bot and in a channel, writing to the bot (#bot)
Why can it be this "painting" problem?
My testing code:
this.onMessage(async (context, next) => {
...
//connectorClient, credentials, ...
...
var activity = context.activity;
var sConversationId = activity.conversation.id;
// Send text message 1
var message = MessageFactory.text("Text 1");
var response = await connectorClient.conversations.sendToConversation(sConversationId, message);
var sActivityId = response.id;
// Update message 1 with a Card
var jsonPath = __dirname + '/' + 'herocard_test.json';
const jsonCard = require(jsonPath);
var message2 = MessageFactory.attachment(CardFactory.adaptiveCard(jsonCard));
message2.id = sActivityId;
connectorClient.conversations.updateActivity(sConversationId, sActivityId, message2);
...
Thanks,
Diego
#Diego Thanks for reaching out!! We could repro this and we have raised a bug for it. We are working on fixing this.

How add attachment into embedded message using EWS

I have a message with ebbedded message, that has own attachment. I have to send this to server using EWS. I can send message with embedded message as attachment, but can't send its attachment, besause AttachmentType doesn't allow add attachment to attachment. Do you know any other ways to solve my problem?
One workaround in that situation that should work is to use the MIMEContent of the ItemAttachment eg
itemAttachment.Load(newPropertySet(ItemSchema.MimeContent));
and then either create a Message based on that or add that as an attachment on a new message eg
FolderId folderid= new FolderId(WellKnownFolderName.Inbox,"MailboxName");
Folder Inbox = Folder.Bind(service,folderid);
ItemView ivItemView = new ItemView(1) ;
FindItemsResults<Item> fiItems = service.FindItems(Inbox.Id,ivItemView);
if(fiItems.Items.Count == 1){
EmailMessage mail = new EmailMessage(service);
EmailMessage OriginalEmail = (EmailMessage)fiItems.Items[0];
PropertySet psPropset= new PropertySet(BasePropertySet.IdOnly);
psPropset.Add(ItemSchema.MimeContent);
psPropset.Add(ItemSchema.Subject);
OriginalEmail.Load(psPropset);
ItemAttachment Attachment = mail.Attachments.AddItemAttachment<EmailMessage>();
Attachment.Item.MimeContent = OriginalEmail.MimeContent;
ExtendedPropertyDefinition PR_Flags = new ExtendedPropertyDefinition(3591, MapiPropertyType.Integer);
Attachment.Item.SetExtendedProperty(PR_Flags,"1");
Attachment.Name = OriginalEmail.Subject;
mail.Subject = "See the Attached Email";
mail.ToRecipients.Add("glen.scales#domain.com");
mail.SendAndSaveCopy();
Cheers
Glen

Htmlunit, bad encoding when submit post

Good day!
Do send a message to the forum.
When sending my data break
added to the header charset, it did not help
What could be the problem?
WebClient webClient = new WebClient(BrowserVersion.CHROME);
page = webClient.getPage(urlPage);
HtmlForm formEditPost = page.getFormByName("postform");
HtmlTextInput subjectInput = formEditPost.getInputByName("subject");
subjectInput.setText("заголовок");
HtmlTextArea messageElement = formEditPost.getTextAreaByName("message");
messageElement.setText("сообщение");
HtmlSubmitInput sendMessage = formEditPost.getInputByName("post");
page = sendMessage.click();

Resources