with IMAP and Enigma?
Using Pipedream's IMAP API, developers can automate interactions with their email inbox, enabling serverless workflows that perform actions based on incoming emails. This could include parsing email contents, triggering events upon receiving emails from specific senders, attaching labels, and much more. By leveraging IMAP, Pipedream can act as a bridge between your email and other services, streamlining processes that would otherwise require manual intervention.
import { once } from "events";
import imaps from "imap-simple";
import cycle from "cycle";
export default defineComponent({
props: {
imap: {
type: "app",
app: "imap",
}
},
async run({steps, $}) {
const { host, port, email, password } = this.imap.$auth;
const connection = await imaps.connect({
imap: {
host,
port,
user: email,
password,
tls: true,
tlsOptions: { servername: host },
authTimeout: 3000
},
});
const boxes = await connection.getBoxes();
// Filter out circular references to parents
const filteredBoxes = cycle.decycle(boxes);
$.export("results", filteredBoxes);
connection.end();
await once(connection.imap, "end");
},
})
The Enigma API offers access to a vast repository of global public data, which can be harnessed to enrich business intelligence, enhance analytics, and automate due diligence processes. By tapping into Enigma's curated datasets on Pipedream, you can seamlessly integrate real-time insights into your applications or workflows, perform comprehensive data analysis, and cross-reference multiple sources to uncover critical information on businesses, markets, and economies.
import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
enigma: {
type: "app",
app: "enigma",
}
},
async run({steps, $}) {
return await axios($, {
url: `https://api.enigma.com/businesses/{your_enigma_id}`,
headers: {
"x-api-key": `${this.enigma.$auth.api_key}`,
"accept": `application/json`,
},
params: {
lookback_months: `1`,
},
})
},
})