AWS SES: Send templated email with template create by another account - aws-sdk

I have a build setup whereby we create SES templates with one user, but we want to send them with another user. I can send templated emails when the template was created by the same user as the one sending, but when I try to send via a different account I get accessdenied. Is this expected? Is there a permission I need to grant to be able to allow this?
I found in the Php docs (though I'm using the CLI and jave/javascript sdks) that templates should be accessible to any account authed for that region but it's not working for us (
https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/ses-template.html)
Any help appreciated!

Related

Convert Gmail mail into file and send over a webservice

Is it possible to create an add-on that can send off the contents of an email into a webservice? I see lots of documentation on add-ons interacting with external webservices and have been able to follow a simple demo about it, but there isn't much I can find about interacting with the emails itself.
I have an add-on in Outlook that grabs the email and sends it off to a webservice, but I want to replicate this in Gmail in some way.
Next, I would also like to know if it's possible to use a different web service based on the user. For example, if I were to deploy this same add-on for a coworker but they needed to send the email to the different service. Is there a configuration file somewhere that controls this?
Lastly, I was also interested in how Gmail add-ons store personalized information, as I feel like it would help clear things up. E.g. how the tasks add-on grabs the right ones for the currently logged in user and where they are stored.
I would be open to any other solutions to this issue.
Communicating with web service
You can use the UrlFetchApp class to connect to any target web service if it can be accessed via HTTP request. If you need to access different web services for different users, you can either do so via storing "user:url" property (see below) or by conditionally changing the URL according to effective user.
Determining the user
You can determine under whose authority the Add-on is running by using a Session class method getEffectiveUser() and getEmail() on the resulting user.
Storing personalized info
As for storing and fetching personalized information, there is a PropertiesService class you can use. Since you want to store info related to end users, you'll need to get a Properties class instance with access to user-specific properties via getUserProperties() method.
Useful links
Gmail Add-ons reference;
PropertiesService class reference;
Guide on PropertiesService usage;
UrlFetchApp class reference;

How to change the content of Email templates in MediaWiki

I have restricted the account creation to only bureaucrats. That is, only bureaucrats can create accounts for other users.
A confirmation email is sent to the newly created user on successful account creation in MediaWiki. But, would like to know where can i change the content of Confirmation Email template that i receive in MediaWiki.
Where can i find the various email templates used in MediaWiki?
For eg: Content of Confirmation Email upon successful account creation is as below.
Someone, probably you, from IP address ::1,has changed the email
address of the account "Admin" to this address on admin's Wiki!.
To confirm that this account really does belong to you and reactivate
email features on admin's Wiki!, open this link in your browser:
I would like to change the above content but couldn't find where these email contents are stored or from where it is invoked.
Any help is appreciated.
The email templates are stored as normal system messages, in the MediaWiki namespace, e.g. MediaWiki:Notificationemail_body_changed.
You can filter out all relevant system messages like this: Special:AllMessages&prefix=Notificationemail
Currently, there are four:
MediaWiki:notificationemail_body_changed
MediaWiki:notificationemail_body_removed
MediaWiki:notificationemail_subject_changed
MediaWiki:notificationemail_subject_removed
Those pages will give you the message in your wiki's default language. To change a specific language (that a user might have chosen), use MediaWiki:notificationemail_subject_removed/ar (Arabic), MediaWiki:notificationemail_subject_removed/en (English), etc
#leo's answer is correct for messages sent regarding email authentication.
All other email messages as related to changes in pages, etc., are stored in system messages that start with enotif_, and you can see them all using this filter:
Special:AllMessages&prefix=enotif_.
The messages for vanilla* MediaWiki are:
enotif_impersonal_salutation
enotif_subject_deleted
enotif_subject_created
enotif_subject_moved
enotif_subject_restored
enotif_subject_changed
enotif_body_intro_deleted
enotif_body_intro_created
enotif_body_intro_moved
enotif_body_intro_restored
enotif_body_intro_changed
enotif_lastvisited
enotif_lastdiff
enotif_anon_editor
enotif_body
And you can see them all using this filter:
Special:AllMessages&prefix=enotif_
* People using extension:Echo have a few other messages to change.

Admin access to Domain User's Gmail?

I'm currently writing an auditing script that is focusing on users' gmails and need access to their message lists. I have admin access and scopes for the AdminSDK, the script will be executed by the admin.
I'm wondering how exactly to do this? I have my domain's userlist via Directory, but I can't use GmailApp with a specific user, only the current user(admin). I was also thinking about assigning a timed Trigger to each of the users and using GmailApp locally, but I can't figure out how to do that either(I don't think this is possible).
One idea that I'm working on is pinging the Gmail API using the admin's credentials via URLFetchApp, but can I get my domain's users information with this method?
What are your thoughts? Any guidance will be appreciated.
I'm currently using GAS on a service account.
While using service account, you can impersonate users in your domain and perform actions on their behalf. For this you will need to perform domain wide delegation of authority in your domain.
Here you can find documentation about domain wide delegation.
Here you can see an example, I know is on Drive but the principle is the same.
Hope this helps.

user email in About service

I need to get the user email when I get document permissions. I have seen this problem here
value attribute for Permissions Resource not populated in responses
but in about service does not appear my email. I need it because I have a service account and my application need know the user email. I want to avoid call to profile service.
Is this possible? from where I can get the user email?
Thanks.
As you rightly say, you will have to make a call to the profile service. In some ways it is better like this, because it separates the concerns of the Drive API and the Profile API, and can use specific scoping to let the user know exactly what they are authorizing your app to do.

Using email to update SQL database

Is it possible to use email to update mysql table?
for example I have someone send email which have today article with the image as an attachment and it have to send to particular email address (eg: abc#something.org) to be able to process data to sql table, other address will not work for updating.
Once it receive, it automatically proceed and update sql from the article it receive.
How is it work?
is there any open source that may help this process
Not by sql, you have to involve some sort of programming language which have a subset of methods to communicate with the database and that can receive and send email.
Take a look at Sendgrid (at http://sendgrid.com): they have a parse API (see http://wiki.sendgrid.com/doku.php?id=parse_api for details) that basically lets you convert an email into an HTTP POST. So if you already have a web page that can update the MySQL database you can just modify it to comply with their spec, set up a sub domain that forwards to Sendgrid and then setup a Sendgrid endpoint that takes any email to that sub domain and posts it to your web page.
It depends on your application. If you're using a framework like Wordpress, there are plenty of plugins available to integrate (e.g. Postie). If you have your own custom application, you may find an open source script to download the new messages, but you'll have to implement your own code to update your database.