Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions components/gmail/actions/get-send-as-alias/get-send-as-alias.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import gmail from "../../gmail.app.mjs";
import constants from "../../common/constants.mjs";

export default {
key: "gmail-get-send-as-alias",
name: "Get Send As Alias",
description: "Get a send as alias for the authenticated user. [See the documentation](https://developers.google.com/workspace/gmail/api/reference/rest/v1/users.settings.sendAs/get)",
version: "0.0.1",
type: "action",
props: {
gmail,
sendAsEmail: {
type: "string",
label: "Send As Email",
description: "The email address of the send as alias to get",
async options() {
const { sendAs } = await this.gmail.listSignatures();
return sendAs.map(({ sendAsEmail }) => sendAsEmail);
},
},
},
async run({ $ }) {
const { data } = await this.gmail._client().users.settings.sendAs.get({
userId: constants.USER_ID,
sendAsEmail: this.sendAsEmail,
});

$.export("$summary", "Successfully retrieved send as alias");

return data;
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import gmail from "../../gmail.app.mjs";

export default {
key: "gmail-list-send-as-aliases",
name: "List Send As Aliases",
description: "List all send as aliases for the authenticated user. [See the documentation](https://developers.google.com/workspace/gmail/api/reference/rest/v1/users.settings.sendAs/list)",
version: "0.0.1",
type: "action",
props: {
gmail,
},
async run({ $ }) {
const response = await this.gmail.listSignatures({
$,
});

$.export("$summary", `Successfully retrieved ${response.sendAs?.length} send as aliases`);

return response;
},
};
2 changes: 1 addition & 1 deletion components/gmail/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/gmail",
"version": "1.2.0",
"version": "1.3.0",
"description": "Pipedream Gmail Components",
"main": "gmail.app.mjs",
"keywords": [
Expand Down
3 changes: 1 addition & 2 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading