send a file to other teams user using command line - command-line

I'd like to be able to send programatically a file to another user or group, preferably with an text message, is there a command that would allow me to do that ?
My input :
situation 1
user : "john.doe#foo.com"
file : "C://this/that/here.csv"
message : "Hi John, here's a csv"
situation 2
group: "my team chat"
file : "C://this/that/here.csv"
message : "Hi all, here's a csv"

You can achieve this by using Team graph api's. Graph exposes two resource for working with files, please check the document. You can not send files directly but you can save it in oneDrive and share the location. You can handle message by sending message card or as activity.

Related

Workflow to send email with a Saved search CSV file attached

I am just wondering if Netsuite workflow allows us to send an email with a CSV file of a Saved search attached, for example:
We want:
State 1: send an email at a scheduled time using a transactional
saved search as a condition, but instead of attaching a PDF file or
inline text, we would prefer to have a CSV file of all of that saved
search result
State 2: after email is sent, update a custom field
Looking forward to your advices

How to open a draft created with Gmail API in browser?

Im trying to create a gmail draft using gmail API and open it in a new tab.
When i try to open a draft using the following url : https://mail.google.com/mail/u/0/#drafts/ draft id , from a external web it does not open the draft. Instead it lists the drafts.
If i do the same in a Gmail tab it works as expected.
You can reproduce it following this steps
Chose any draft and copy its message id , you can use this
Create a url joining https://mail.google.com/mail/u/0/#drafts/ + the message id you got in the last step.
Open a new tab in Chrome and paste it, it will send you to your draft list.
If you paste the same url in the the same tab it will open the draft.
More information about the problem
It does not work with https://mail.google.com/mail/u/0/#drafts/?compose= neither
Chrome console throws this error when i try to open a draft from another tab
console error
I noticed if you open a draft the url is like this one https://mail.google.com/mail/u/0/#drafts?compose=JHrtffLJpZXxNwzKGMhcjvjBrqfPRwKWvkvJbtWpRffXldzxkNQhmkkBWJsHPbdSPdDgBVKpHKZMNtCVFgXrhwMCVjCdCRqTLJhGvqrXNKFZmJDGZ , this url works also to open the draft editor from other tabs, but where does the compose value come from?
I know it is not a API error or problem but if somebody had the same problem and know any way to solve it i will apreciate.
So the question is, how can i create a url to open a gmail draft using Gmail API ?
The way to make this url changed, now it works like this:
mail.google.com/mail/#inbox?compose=draft.message.id
If you list your drafts you get
{
"drafts": [
{
"id": "r5632827412362757569",
"message": {
"id": "174f4fa0dd96af123",
"threadId": "174f4f59344d6321"
}
}
],
...
}
So, to open this draft you need the following url :
mail.google.com/mail/#inbox?compose=174f4fa0dd96af123
Your goal:
To be able to open a browser tab directly focused on a specific draft of your choosing, from the drafts in your mailbox. (Correct me if I'm wrong).
Background:
You noticed that drafts have a "compose" parameter visible in the url when focused within the UI.
The drafts resource doesn't include the "compose" parameter, so we can't get it from the API, and it also isn't equal to the draft id.
Conclusion:
Since the parameter needed is not publicly available via API, you can't achieve your goal at the moment. You can request the feature to Google directly by creating a "Feature Request" for the Gmail API. Here's the link Issue Tracker.

telegram bots, how to request input from user?

I know how to use telegram commands, and know how to read what command has been executed. What I would like to do is something like this:
User: /send_address
Bot: Hello, please type your address..
User: my address...
so far, i can read the /send_address command and reply with "hello,...." and obviously I can also read the answer of the user, just like I have read the /send_address command. Question is, how do i know if the answer he sends is in response to my "hello, please type your address.." request, or if he sent it just because? I could have 100 users chatting with the bot, would i have to store a variable for each user remembering that he sent the /send_address cmd?
As I known, telegram has no way to save state for user. I use a table in database for saving comands of user.
How it works:
User say /command
Store /command for User.
User say "something" we try to get data from database for this user. If we find out that previos message is command /command than do some action and save nowly added data (if you have multiple steps for some command)

how can i delete a Facebook Test User with 2+ apps using the Graph API

When i try to delete the user like it says in the docs (http://developers.facebook.com/docs/test_users/#deleting) i get the error response :
(#2903) Cannot delete this test account because it is associated with other applications. Use DELETE app_id/accounts/test-users/test_account_id to remove it from other apps first. Use GET test_user_id/ownerapps to get complete list of owner apps.
then when i try to do what it says (replacing <user_id> and <app_id> with a facebook numeric id) :
DELETE <app_id>/accounts/test-users/<user_id> to remove it from other apps first
i get this error :
Unknown path components: /<user_id>
am i missing something ?
As the error said you cannot delete an user because it has been assigned to two or more application.
The workaround for this is to get all the applications which are using this specific user using this call
"https://graph.facebook.com/TEST_ACCOUNT_ID/ownerapps&access_token=YOUR_APP_ACCESS_TOKEN"
This will give you the list of app the test account is attached to prior decoding the object with a JSON serializer. Then you can remove and not delete the test account from each app until only one remains using :
"https://graph.facebook.com/APP_ID/accounts/test-users?uid=TEST_ACCOUNT_ID&access_token=APPLICATION_ACCESS_TOKEN&method=delete"
When only one app remains you can delete the test account using :
"https://graph.facebook.com/TEST_ACCOUNT_ID?method=delete&access_token=TEST_ACCOUNT_ACCESS_TOKEN"
Hope this help!

Configurating JOOMLA's e-mail notification for new account

I'm using Joomla 1.5 to create a local site for my office. The site will be accessed locally via intranet, and my PC will be the localhost for the site.
I'm using a Login pluggin, so that anyone who wanted to enter the site should create an account.
In JOOMLA, all user who created their account for the first time will receive a notification e-mail like :
"Hello pras,
You have been added as a User to Information Center by an
Administrator.
This e-mail contains your username and password to log in to
http://localhost/yaddayadda/
Username: hadisuryo.prasetio Password: xxxx
Please do not respond to this message as it is automatically generated
and is for information purposes only."
but if the user click the URL in the mail, which is, "localhost/yaddayadda/" they will not be directed to my site, but to their own PC's localhost....
My question is : How can I Modified the e-mail or the site configuration so that the URL will not be "localhost/yaddayadda/" anymore, but will be "(My-IP address)/yaddayadda"
I'm not going to host my site to a web hosting service, just using my PC as a host.
I've been trying to trace on each config and .ini files...it seems that i have to do something with the "JURI" function or the "$mosConfig_live_site" on the backlink.php file
$mosConfig_absolute_path = JPATH_SITE;
$mosConfig_live_site = JURI :: base();
$url_array = explode('/', $_SERVER['REQUEST_URI']);
Can anyone give me assistance ?
actually what the joomla does it takes the value as $_SERVER for the host so what you have to do u just append "/yaddayadda" at the email template of the joomla
You could edit:
%SITE_ROOT%/administrator/language/en-GB.com_users.ini at around LINE 28, which reads
NEW_USER_MESSAGE=Hello %s,\n\n\nYou have been added as a User to %s by an Administrator.\n\nThis e-mail contains your username and password to log in to %s\n\nUsername: %s\nPassword: %s\n\n\nPlease do not respond to this message as it is automatically generated and is for information purposes only.
Be careful with the '%s' variable as it appears to insert different values in each instance. First instance renders their NAME, second SITE NAME, third one is the USER NAME, etc, etc.
-Dennis
You can find those values in root/components/com_users/models/registration.php on line 88. It appears it pulls it out of the array that is being created their.