How to save user preferences? - gmail

We're developing a Gmail Addon to help internal staff to handle customers' email.
Our card widget will have a table with 2 column; first cell of every row will host, one or more domains, and the 2nd one will contains an editable text box with the default label that the addon will add to this user.
I'd like to allow user to change the default label, to adapt to his/her preferences and actual labelling method, adopted in some cases since years.
So the problem: how to save the user preferences, the user settings, of our addon only of course, but keeping related to user account? The goal is allow user to login with different devices and find the same settings

The sample Gmail add-ons projects that Google have published on Github should help you. In particular I've just found this Settings.js source file.
The core seems to be
var savedSettings = cachedPropertiesForUser_().get("settings", {});
But I've not used this in anger.

Related

Kentico 8.2 Newsletter Link and unsubscribe link

I have created a contact form under Forms with first name, last name, and email that is designed to sign up people for a newsletter. I then created a page so when people click on the link placed on the home page it takes them to a page with the contact form.
Right now when I test the subscribe form out, the data does to to the "back office" where it can be retrieved. However, the information I entered is still in the text fields and, unless you notice the small flash of the web page, one might think nothing happened.
I'd like to know how (or be directed to somewhere in the Kentico 8.2 Documentation) I can make it so that the fields clear and a message appears saying "You have been subscribed to the newsletter." That message can either appear on a separate page on the web site, or send a message to the user email, or both. In the Email Marketing part under the templates there are Subscribe and Unsubscribe templates, but I don't know how to use those.
The other issue is creating an Unsubscribe link. Ideally that will open up to a new page saying "You have been unsubscribed." Kentico 8.2 has an unsubscribe page you can create where the user enters in an email address and then hits the Unsubscribe Request button, but I'd rather not do that. As it stands, I did create a page with that form and tested it, but it doesn't seem to work.
When you edit your form, under general tab, there are settings for what will happen after the form is submitted:
Display Text
Redirect to URL
Clear Form
Continue Editing.
Currently you're using the standard Forms application for something which can be managed through the Newsletter/Email Campaign module. Read the documentation more on how to configure this vs. using the Forms application.
Essentially the steps you will do are:
Create your newsletter following the directions in the linked documentation.
Place a newsletter subscription webpart on your page template and configure it to the newsletter you want them to subscribe to.
Use the out of the box unsubscribe feature to allow users to unsubscribe to your newsletter. No need to add any page to the content tree but you can if you want OR just use the OOTB functionality.
If you follow the documentation you should be able to get it setup properly vs. using an online form.

Add condition for smart-app-banner?

i'm using smart-app-banner for site. How i can add some condition for showing this banner? For example, user entered on our site but did not do any things with banner(close or install), that is why if he well return on our site next time, we must show this banner for him only after three days.
You should check out this alternative to the solution you are currently using as it states: "When a customer visits your site, Desktop users are sent an SMS with a link to download your app. Mobile users are automatically directed to the appropriate app store."
https://github.com/ombori/app-banner

Google Doc onopen have menu show up for specific user

Is it possible with Google Apps Script to either
A. Have a custom menu show up only for specific users?
or
B. Only allow specific users to click on a menu item.
I'd like to use the get active user command and try to bounce that off of a specific cell in another Google sheet in which our secretary maintains of about 5 administrators. Pull the email address from the sheet make it a variable called principal or directorOfTechnology etc. and have some kind of if statement so that either a menu only shows up for that person or an if statement so that if they are the correct person it does what I have and if not they get a message or something saying You are not able to click on this button etc.
If this is possible how would I go about writing this code? I am still in the learning stages and am not sure how to get this started and if this is even possible.
Doing this in the way you describe runs up against the fact that onOpen() runs in 'limited' authMode: you won't be able to read from the spreadsheet until the auth cycle is complete & your script gets to full authMode. (documentation)
Here are 2 possible work-arounds:
You can specify a list of authorised accounts in your script & check against them. This makes it difficult for a third party to manage the ACL as they have to modify the script directly.
You can deploy the script as a Sheets add-on & make it accessible only to members of a Google Group. e.g. You can then devolve management of the access group to a third party.

Set field via URL

Is it possible to have a field in the current item be changed by clicking a URL? The field would be a choice field with predefined choices.
Such as if the item field is currently:
Status: 2
If a user clicks the link, the field would now be:
Status: 3
If not, is there any other way for a user to easily change a field in the current item without actually haveing to visit the item?
Thanks!
Not Out Of The Box (OOTB) - but you've a few options.
Write an ASPX page to do what you want
Use something like SPServices and javascript to update the list item via the web services.
Use the Client Object Model (2010 only)
By the way - changing stuff on a 'get' can be dangerous as you can do malicious things - for example imagine you have a page that deletes the users account without any prompting (exact example doesn't matter) - what if someone clicks on that link by mistake or even worse what about an email sent with an image with that page as source URL - simply viewing the email could delete the users account.
It's not possible by using a GET request, but SharePoint 2010 is offering a RESTful API to manage ListItems from any client
The REST API is located within the virtual WebServices folgder under each SharePoint Site.
http://YourSharePointSite/_vti_bin/ListData.svc.
To perform an update on SharePoint ListItems you have to create a PUT Request. For more information on SharePoints REST API you should have a look at this MSDN site, there are also a lot of samples linked from this article.
Thorsten

Reload/Refresh an ABPersonViewController

In my app, users can view and edit their Address Book contacts. Right now, I'm trying to support iOS 4 backgrounding.
Here's my problem. If a user is viewing a contact, say "John Appleseed" in my app, the user can then switch to the iPhone Address Book, open "John Appleseed," and change his contact info. If the user then switches back to my app, my app's view of John Appleseed is now out of date. I want this view to refresh with the new info. Obviously, the user can close and reopen the contact in-app (or the app can do this programmatically), but this is a less than ideal user experience.
I know this is possible the other way around i.e. user edits contact in-app and switches to the iPhone Address Book and the view auto updates.
I already know how to detect if a change has happened, but I want to be able to refresh the view. I am using an ABPersonViewController. Unfortunately, since this isn't an instance of UITableViewController, I can't just do [self.tableView reloadData]
Thanks in advance for any help on the issue!
If you already know how to get the new contact information as ABRecordRef, then try
yourABPersonViewController.displayedPerson = yourNewABRecordRef;
[yourABPersonViewController.view setNeedsDisplay];

Resources