Custom Headers in Logic App With Outlook Connector - azure-logic-apps

I am using custom headers via the office js library here https://learn.microsoft.com/en-us/javascript/api/outlook/office.internetheaders?view=outlook-js-preview to pass meta data in the email headers.
I can see that the header is added but when it is received via the logic app, the custom headers have been removed.
Is this a known issue? Is there a way to prevent the stripping of custom headers?
thanks

The outlook and sendgrid connector in logic app don't support custom header. So you could use logic app with Azure function, in the function forward email.
You can vote up this feedback to promote the feature to be achieved as soon as possible.

Related

How to implement mailing server with Next.js?

I am pretty new to Next.js and I want to implement a mailing feature for a contact form which I have on the site. Since Next.js is SSR, if we need to use a mailer I wonder: do we still need to have a separate backend environment where we then need to install the mailer (for example Node.js and Nodemailer) or we can install the mailer (for example Nodemailer) directly into the Next.js setup?
I know there is an option for having separate Node.js server, proving an API endpoint and using this endpoint for triggering the method where we will send emails (and probably send all the values from the contact form as a parameters in the endpoint), but I wonder if the Next.js allows direct implementation of a mailer nested directly into it's setup.
Next.js allows for creating custom API routes right within the project.
Here are the Docs:
https://nextjs.org/docs/api-routes/introduction
You need to create files in pages/api and the endpoint will be mapped to /api/*

Sending an email from contact us form using only Angularjs and Send grid without back end API in place

I have taken a look around the internet and all the solutions emphasize using Express and Node Js API in place to able to send an email. I would love to see any suggestions on how to best go about it because I don't have a backend in place. Thank you.
You're going to need some sort of backend otherwise the API-Key will be exposed.
From the SendGrid documentation:
When you have a browser-only application that reaches out to APIs, the API key has to be embedded in the application. Anyone with access to a browser-only application can access all of the Javascript source code, including your API keys.
Making your API key publicly accessible could result in anyone authenticating API calls with your API key — this is a significant security concern both for you and SendGrid.
You could use a serverless AWS lambda function or google function which would be a "backend" but without having to support the infrastructure / use a big framework.

How to access the Google Maps Directions API client-side from a library

I'd like to send requests against the Google Directions API. Google provides a Node.JS client library for the API. However, this AP is server-side only. Attempting to use it from a browser script results in a CORS failure. Multiple past answers (such as this one) indicate that this library simply can't be used in this way.
The alternative is to use the client-side JavaScript API. However, this requires adding a <script> tag to the document root. That's the wrong level of abstraction for my needs. I'd like to use a method from a library or dot-js file instead.
Following the advice given here, I'd like to ask: is there a module available through npm I can use to query the Google Directions API client-side?
It's not naively possible to access the Google Maps Directions API from the client side. Web browsers implement the Single-Origin Policy, which requires that any requests to a domain come from the same domain. Requires between domains are disallowed by default. Cross-domain requests can be enabled at the server lever by setting the right CORS headers on the endpoint, but the Google Maps servers choose not to do this.
There are two ways of working around this. One is to wrap the request using the Google API Auth library. However, I could not get this to work.
What did work was using a reverse proxy. This workaround is actually mentioned in the Google Directions API intro page (albeit obliquely). You will need to set up a server which forwards any requests to an API request, then returns that API request to the original requester. Since this is now a server-side request, SOP will not apply, and you will be good to go.
For an example implementation check out this repository on GitHub.
https://developers.google.com/maps/documentation/directions
This is the Directions API web service. It does not require adding a <script> tag.
You can make direct requests to the service as per the example:
https://maps.googleapis.com/maps/api/directions/json?origin=75+9th+Ave+New+York,+NY&destination=MetLife+Stadium+1+MetLife+Stadium+Dr+East+Rutherford,+NJ+07073&key=YOUR_API_KEY
once you have generated an API key and replaced YOUR_API_KEY in the request with your own key.

Get attached files with InboxSDK and send them via Gmail API

I am using InboxSDK and gmail API on PHP to build a chrome extension.
Everything is flowing quite okay so far, but I am facing a big obstacle.
What is my purpose?:
Via InboxSDK, I want to handle when a user attaches files.
Send all the information to my server.
Attach the files and send the mail via Gmail API from the server.
Where am I?:
I already authorize the user with OAuth2.0 and keep the tokens and also I am already able to send the e-mails written in Gmail Web via server Gmail API.
I do not know how to move on with handling the files.
How may I proceed?
Also, if there is any alternative way to achieve this without InboxSDK I am happy to hear.
Thank you.
It is not possible as mentioned.
But there is a workaround.
Create a draft via InboxSDK.
Fetch the draft via gmail API.
Send the created draft, which already contains the attached files.

Custom authorization support in Apache webserver

I would like to know if I can hook in a custom authorization support in apache2 webserver. What I want to do is, based on the user logged in, I want to disable few HTML pages being served to UI. The logic to check permissions to static resources (html, css, js etc) for a given user is little complex so I cant use the already available authorization and access control support of apache2. I would want all the requests for static resources in my webapp should first go through my custom module (authorization) which then decides if this request can be served or redirected to some error page.
What is the best way to achieve this?
This article talks about mod_python to implement custom Apache/Subversion Authentication/Authorization, but is quite generic.
Combined with the standard <Location> Directive this can be a solution for your problem.

Resources