Is there any way apply the rules to history emails with EWS - exchangewebservices

Is there any way apply the rules to history emails with EWS?
When calling UpdateInboxRules (Create Rule),I want the rule to take effect immediately.

No you can't retrospectively apply a Rule using EWS (Like you can in Outlook) if you want to do that you need to create you own code to enumerate the messages and apply whatever logic is in the rule to messages.

Related

Is it possible to automatically apply a label if another email with same sender has label

In Gmail, is it possible to create a filter to automatically applies a label to an email if another email with the same sender already has this label.
For instance, sssuming I have an email from johndoe#gmail.com with label MyLabelA, can I create a rule that will apply the same label to another email from johndoe#gmail.com? Note that the label MyLabelA will be applied to hundreds of emails with multiple recipients and I can't use johndoe#gmail.com directly to define the filter.
I have seen this question but I am wondering if there is a way of achieving this without writing a script.
From the question:
I have seen this question but I am wondering if there is a way of achieving this without writing a script.
Gmail filters are not able to assign a label based on information of other email messages, so no, it's not possible to assign a label using built-in features.
Reference
Create rules to filter your emails
You can check on Create rules to filter your emails:
Open Gmail.
In the search box at the top, click Show search options.
Enter your search criteria. If you want to check that your search worked correctly, see what emails show up by clicking Search.
At the bottom of the search window, click Create filter.
Choose what you’d like the filter to do.
Click Create filter.
You can also create a filter based on an email:
Open Gmail.
Check the checkbox next to the email you want.
Click More.
Click Filter messages like these.
Enter your filter criteria.
Click Create filter.

How do I insert a Horizontal line in a google document via Google Apps Script?

I wrote a script that takes some data from a google spreadsheet and writes it in several separate tables in a google document.
Since I need to physically cut these tables from the printed document, I'd like to add horizontal lines between them.
I guess I can insert an image of a line, via
var cutline = UrlFetchApp.fetch("SOME URL");
body.appendInlineImage(resp.getBlob());
where "SOME URL" is the url for the image.
Another way I can think of would be creating a one-column table and add my tables in its cells. The horizontal lines for the table would be my cutting guides.
However, from the user interface I a horizontal line can be easily added via "Insert>Horizontal Line". I was not able to do find a way to do that from Google Apps Script.
Is this unsupported?
Can someone confirm that and/or possibly suggest method that is less cumbersome than those I thought of?
EDIT: I have also found the HorizontalRule class, which I do not understand entirely. However I don't think it's what I'm looking for.
Another alternative could be an InlineDrawing. However, from this guide, I gather that an InlineDrawing can only be manipulated, but not added programmatically.
HorizontalRule should do the magic.
This code worked for me:
DocumentApp.getActiveDocument().getBody().appendHorizontalRule();
More info:
https://developers.google.com/apps-script/reference/document/horizontal-rule#copy()
DocumentApp.getActiveDocument()..getBody().insertHorizontalRule(0)

Html signatures: how to prevent user editing

I have made some .html signatures for one of our clients, and there are two things they want I can't figure out how to achieve.
One of them, the client wants the text inside the signature to not be editable by the user, that is to prevent them from accidentally changing something in the signature when sending an e-mail. Is this somehow posible?
The second issue, they said they can resize the images in the signature using the mouse. I also need to prevent this so that they cannot accidentally deform the logo or enlarge or diminish it. How can I do it? I tried setting width and height attributes to the images, but that doesn't prevent them form resizing it at will.
Any help or orientation will be really much appreciated.
Thanks
maybe you can create an image with the entire signature, so it won't be editable.
EDIT
Take a look at this link, maybe you will be able to add the signature after the send button is click.
How to modify email before sending
There are a few options:
1.) If you use an exchange server, you can set a Group Policy to add a signature server level and then another to remove permissions for signature access to all users. This will give you 100% control on all Outgoing messages. This is supposed to be used for disclaimers, so in a long email chain, the signatures may wind up at the bottom of the chain, not the message. See for more info: http://www.howto-outlook.com/howto/corporatesignatures.htm
2.) Another option is to run a script. This option steers away from using Group Policy, but I believe it would require action done on user level for each person, which may be an issue in a larger company. See here for more info: http://www.edugeek.net/blogs/thescarfedone/1016-centrally-managing-signatures-outlook-owa-free-way.html
3.) Last option I know of is to make signatures folder read only and insert the signature file directly on each person's computer. This is a very manual process and time consuming and certainly not scalable. See here for more details: https://support.office.com/en-us/article/Copy-email-signatures-to-another-computer-4e03286f-2246-4d7d-ae95-a4cc1992595a?CorrelationId=0db01a3d-f8b9-4bfb-af86-37cd4dcf6ef9&ui=en-US&rs=en-US&ad=US

Polymer CoreInput set custom validation message and reverse direction

First
It looks like it's possible to set custom validation rules, but I'm wondering if there is any way to customize the validation messages (I need them to be in Arabic).
Second
Is it possible to reverse the direction of paper-input floating label (place it at top right instead of top left).
First
paper-input exposes a error attribute you can use to declaratively set a custom message. If you want to use core-input directly, that element exposes a setCustomValidity(message) for setting it.
http://www.polymer-project.org/docs/elements/core-elements.html#core-input
Second
That would be a good feature request to file against paper-input. I was able to get something working using CSS overriding, but the internals of the API could change in the future.
http://jsbin.com/megafucuvapo/1/edit

Using either GET or POST depending on submit button

I have a web application for tagging data and viewing data by tag, so my UI is a list of checkboxes for each tag, a list of checkboxes for each data item, a "Tag" button, which adds the checked tags to the checked data, and a "Filter" button, which ignores the checked data and just displays only the data items with the given tag.
My problem is that the former operation (tagging data) is "obviously" a POST operation, whereas the latter operation (viewing data according to a tag) is "obviously" a GET operation. But the method attribute is attached to the form, not the submit button, so I have to choose one or other for both buttons.
I don't want to make two forms, since as far as I can tell this would force me to duplicate the entire tag list. Is there any way I can choose my method based on the choice of submit button?
A JavaScript solution is permissible, but one without would be preferred.
(I am going to post an answer to this question, but I don't particularly like it, so I would welcome alternatives).
In principle, you could use the formmethod attribute in a submit button, as per HTML5. However, it is not recognized by IE, even in IE 9. The existence of the feature in HTML5 indirectly proves that previous versions of HTML lack a feature for this.
On the other hand, the POST method can be used even for simple viewing that does not cause any changes in the outside world, and in many situations it has to be used for technical reasons (e.g., too much data). So I think the method issue is not very relevant; just use POST.
I would honestly go with a javascript solution, in the onsubmit of the form fire a method which a) checks the submit button that was pressed and b) based on this changes the method of the form.
One possible solution would be to use POST, and then have the server give a 303 See Other header to change it into a GET request. This involves making two requests to serve the purpose of one, which is unfortunate, but at least means that the URL will change so people can link to a specific tag selection.
I agree with javascript solution, proposed by Jon Taylor, the problem is not if your form's method is GET or POST, but how do you filter/validate/sanitize user input. If your concern is related to the fact, that the user can manipulate the form's method, then you should implement solution to that matter on server side.