Security News
New Python Packaging Proposal Aims to Solve Phantom Dependency Problem with SBOMs
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
@input-output-hk/mailchimp-subscribe
Advanced tools
An internationalization friendly mailchimp subscribe library. Subscribe emails to your mailing lists.
npm install --save @input-output-hk/mailchimp-subscribe
or
yarn add @input-output-hk/mailchimp-subscribe
import subscribe, { SUCCESS_CODES, ERROR_CODES } from '@input-output-hk/mailchimp-subscribe'
async function submitForm (email) {
try {
const result = await subscribe({
email,
uID: 'XXXXXXXXX',
audienceID: 'XXXXXXXXX',
listName: 'XXXXXX.XXXX'
})
const successCode = result.getCode()
switch (successCode) {
case SUCCESS_CODES.CONFIRM_EMAIL_ADDRESS:
// Successfully subscribed, user needs to confirm email
return '' // Use the code to return a localized string message
case SUCCESS_CODES.GENERIC:
// Successfully subscribed, default code
return '' // Use the code to return a localized string message
}
} catch (error) {
// Original message returned from mailchimp
const message = error.message
const errorCode = error.getCode()
switch (successCode) {
case ERROR_CODES.INVALID_EMAIL:
// Email invalid
return '' // Use the code to return a localized string message
case ERROR_CODES.INVALID_EMAIL_DOMAIN:
// Domain section of email invalid
return '' // Use the code to return a localized string message
case ERROR_CODES.INVALID_EMAIL_USERNAME:
// Username section of email invalid
return '' // Use the code to return a localized string message
case ERROR_CODES.EMAIL_ALREADY_SUBSCRIBED:
// Email is already subscribed to mailing list
// Additional context is available here
// Link to manage the subscription for the email address
const manageSubscriptionLink = error.getContext().manageSubscriptionLink
return '' // Use the code to return a localized string message
case ERROR_CODES.TIMEOUT:
// Request timed out
return '' // Use the code to return a localized string message
case ERROR_CODES.GENERIC:
// Generic error code, server errors etc.
return '' // Use the code to return a localized string message
}
}
}
import subscribe from '@input-output-hk/mailchimp-subscribe'
async function submitForm (email) {
try {
await subscribe({
email,
uID: 'XXXXXXXXX',
audienceID: 'XXXXXXXXX',
listName: 'XXXXXX.XXXX'
})
return true
} catch (error) {
// handle error
// error.message is the message returned from Mailchimp if the error originated on mailchimp
return false
}
}
import subscribe from '@input-output-hk/mailchimp-subscribe'
async function submitForm (email) {
try {
await subscribe({
email,
uID: 'XXXXXXXXX',
audienceID: 'XXXXXXXXX',
listName: 'XXXXXX.XXXX',
customFields: {
MY_FIELD: 'value',
MY_SECOND_FIELD: 'value_2'
}
})
return true
} catch (error) {
// handle error
// error.message is the message returned from Mailchimp if the error originated on mailchimp
return false
}
}
import subscribe from '@input-output-hk/mailchimp-subscribe'
async function submitForm (email) {
try {
await subscribe({
email,
uID: 'XXXXXXXXX',
audienceID: 'XXXXXXXXX',
listName: 'XXXXXX.XXXX',
// 6000ms
timeout: 6000
})
return true
} catch (error) {
// handle error
// error.message is the message returned from Mailchimp if the error originated on mailchimp
return false
}
}
Contributions are welcome, see contributing for more info.
FAQs
Lightweight mailchimp subscriber library supporting custom fields
The npm package @input-output-hk/mailchimp-subscribe receives a total of 6 weekly downloads. As such, @input-output-hk/mailchimp-subscribe popularity was classified as not popular.
We found that @input-output-hk/mailchimp-subscribe demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
Security News
Socket CEO Feross Aboukhadijeh discusses open source security challenges, including zero-day attacks and supply chain risks, on the Cyber Security Council podcast.
Security News
Research
Socket researchers uncover how threat actors weaponize Out-of-Band Application Security Testing (OAST) techniques across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.