1.0.0 • Published 16 days ago

@hoangcung1804npm/sequi-quibusdam-perspiciatis v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
16 days ago

loopback4-mailer

Installation

Install CloudfrontComponent using npm;

$ npm install @hoangcung1804npm/sequi-quibusdam-perspiciatis

Basic Use

Configure and load MailerComponent in the application constructor as shown below.

import {MailerComponent, CloudfrontComponentOptions} from 'loopback4-mailer';
import * as aws from '@aws-sdk/client-ses';
// ...

const ses = new aws.SES({
  apiVersion: "2010-12-01",
  region: "us-east-1",
  defaultProvider,
});

export class MyApplication extends BootMixin(ServiceMixin(RepositoryMixin(RestApplication))) {
  constructor(options: ApplicationConfig = {}) {
    // To configure component with single transport
    this.configure(MailerBindings.CONFIG).to({
      transport: [
        {
          name: 'default',
          transport: {
            streamTransport: true,
          }
        }
      ]
    });

    // To configure component with multiple transport
    this.configure(MailerBindings.CONFIG).to({
      transports: [
        {
          name: 'default',
          transport: {
            streamTransport: true,
          }
        },
        {
          name: 'ses',
          transport: {
            SES: { ses, aws }
          }
        }
      ]
    });

    this.component(MailerComponent);
    // ...
  }
  // ...
}

Usage

Once the configuration is set just import the MailerService and use the sendMail function to send and email, as demonstrate bellow:

import {service} from '@loopback/core';
import {MailerService} from '@hoangcung1804npm/sequi-quibusdam-perspiciatis';
import {get} from '@loopback/rest';

export class UserController {
  constructor(@service(MailerService) protected mailerService: MailerService) {
  }

  @get('/users')
  async create() {
    //create user...
    const {email} = user;
    await this.mailerService.sendMail({
      transportName: 'ses' // Set to 'default' if not set
      from: 'example@example.com',
      to: email,
      text: 'Verify your account'
    })
  }
}

Template adapter

Debug

To display debug messages from this package, you can use the next command:

DEBUG=loopback:mailer npm run start

Tests

Run npm test from the root folder.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

This project is licensed under the MIT

regularwatchFileObject.definePropertyboundeventEmittereslintECMAScript 2018hasOwnlessreducerexit-codeurlparsecompile less@@toStringTagchinesecacheWebSocketsArray.prototype.flattapetyped arrayless compilerreducevalidatorlintfstraversereadablestreammoveparentArray.prototype.findLastIndexparentscolumnformatconcatMapdebugFloat64ArrayoutputstyleES2017east-asian-widthfullwidthmobilemake dirsettingsextensionmonoreporequestfullbrowserlistES2016duplexsymbolsnativerapidObject.valuesmimeserializerlazytypedarraysbindsortedexecmime-dbratefigletdataViewvariablesfind-upworkspace:*protocol-bufferssigterma11yoperating-systemspinnerdescriptorsECMAScript 2019flatMapcollection.es6equalityclassname256taskdeeptrimRightcryptoemitspringFloat32Arraycall-bindloggerminimaltypestringifiernameschemaCSSStyleDeclarationinstallerlinewrapvarrm -rfbrowserslistlistenersarraybufferdependenciesirqiteratortypedarraylastnested csscommandvesteslint-pluginlinkobjectcloneloggingcallbackcharacterdescriptorECMAScript 2022xhrpipermcolumnspreprocessorastbabel-coreposemergebannertouchArray.prototype.flatMapwrapenderbundlerprocesswhatwgstarterserializeArrayes8lruansipolyfillinternal slottypestoArraybuffersmomentES7mkdirframerpathdom-testing-librarytypescriptqsmixinsInt8ArraylesscssperformanttoStringTagtypedReflect.getPrototypeOfphoneargsTypeBoxpropertiesscheme$.extendshamlimitsanitizationtapnumberviewaccessorlibphonenumbergetURLSearchParamscolorscompareharmonyreal-timeprivatebddcopywatchletsearchhelpersarrayUint8ArraygenericsObject.getPrototypeOfcode pointsextendnamesworkerlogtimerfc4122shebangeslintpluginguidavaescapecryptdependency managertypesafeutilitiesdeterministicpostcssexpresshaswalkinglinuxBigInt64ArrayStreamiteratelengthreuseasciiflatlanguagebatchratelimitstylesgetterupqueuees2016valid[[Prototype]]ponyfillgetPrototypeOfjsonschemaReactiveExtensionsObservablessignalpackageparserES6prettystreams2chromiumpasswordemojiasyncstatuscss nestingmimetypestranspilenpmtoolkitdataterminalless.jsformclientRxJSpackage managerreadwarningclijsdiffslicecharactersAsyncIteratorstreamsimmutablematchesomittestlimitedtesterES2018optimizerweakmapisgroupshrinkwrapfileenumerableclassnamesxtermbcryptconstESnextconcatwindowsindicatoresdragRegExp#flagsArray.prototype.findLastESpuresafekeysStreamsECMAScript 2021serializationdefineArray.prototype.containsjestinternalECMAScript 2017sharedarraybufferthreemrujwtbootstrap css__proto__busyinputbrowseri18nArrayBuffer#sliceSymboles2017-0ArrayBufferObservablesuperstructsetauthenticationeslintconfigperformanceweaksettoolswebinstallpromisesaccessibilitymakeassignprotojsdomECMAScript 3findLastfindmulti-packagemiddlewareio-tsbuffernopewidthes-shim APIspectestingencryptionjson-schema-validatoryupMicrosoftnodeflagredux-toolkitES3Symbol.toStringTagwordbreaktrimStartES2021textjsfastifyrm -fres5propcompilereventsresolvejsxassertreact poseairbnbprunedescriptiontrimstringnegative zeroarrays3dfindLastIndexsequencejsonpathbyteLengthpushequalflattenpackageshookformvaluesvariables in cssfoldergetoptfastUint8ClampedArraytrimEndpicomatchpostcss-plugincollectionArray.prototype.flattenECMAScript 2020syntaxerrorargvcss lesspoint-freetddrmdirvaluecoerciblecolorregular expressioncssramdajapanesetostringtagshellwgetmodulespreserve-symlinksobjHyBigesturesclass-validatorpatchwritewalksuperagentutilstructuredClonecontainsframeworkbootstrap lesslook-upreact-hook-formUint16Arrayerror-handlingfunctionalfpformattingrgbvalidateawesomesauceECMAScript 6circularxssreact animationgetOwnPropertyDescriptorreactnegativefast-deep-clonesortconnectargumentES2020formsbabelPromiseprivate datacurlrangeerroranimationWebSocketpersistentdropinferenceES5typeofcommand-linesymlinkforEachautoprefixermochacolourString.prototype.trimassertsstreamtsjQuerywaittermES2022pnpm9fast-deep-copyFunction.prototype.namesymboles2015removetslibECMAScript 2023watchingObject.entriesECMAScript 2015Int16ArrayIteratortoobjectargparsetrimLeftstdlibString.prototype.matchAllconfigtacitECMAScript 5globMapcallpositiveRFC-6455telephonearktypesymlinksstringifykeyprefixquerystringsanitizemaptypeerrorecmascriptmetadataObject.fromEntrieslockfilefixed-widthhttpsgraphqlES2015flagsspeedidlepluginsetterfromECMAScript 7l10nuser-streamsgradients cssgetintrinsicconsumetranspilerRxTypedArraydayjsform-validationeventDispatcherdeepcloneruntimecjkartcorebyteOffset6to5less mixinsObject.isiterationajvinspectloadingqueryURLstylingtc39less cssspinnersutilityzeroPushdiffhandlersconfigurablepromiseisConcatSpreadableopenWeakSetcensores7sideerrorfastcopyfastcloneJSON-SchemainterruptsfetchbytewordwrapreduxUnderscoreUint32Arraykarmaefficientdomkoreanmkdirpsharedsigintcommanderenvfull-widthJSONfile systemeveryES2019throttleutil.inspecthigher-orderzodslotbreaksignalsgradients css3nodejspopmotiones-shimsObject.keysdirfast-copysyntaxrequireextraSetievalidationsetPrototypeOfprotobufmatchAllgroupByregexstylesheetReactiveXmodulevisualdeepcopyfantasy-landpyyamluuidprogressquotestatelessObjectelectrondefinePropertyECMAScript 2016computed-typesgdpr0exitajaxcheckcreateBigUint64ArraylooksomeonceauthoptionoptimistfilterTypeScriptmatchArray.prototype.filterutilscallbindprototypechromeclassesestreecorsfunctionmkdirsimportdatebluebird_.extendjson-schema-validationreact-hooksexpressioncurrieddeep-cloneyamlcallboundsetImmediatecall-boundrandomjavascriptshimqueueMicrotaskapolloregexpenvironmentfinduprecursiveregular expressionsmacoswhichtypanionhttpES8concurrencyreact-testing-librarywaapistableArrayBuffer.prototype.slicecss variableES2023es-abstractscheme-validationdebuggerObject.assignes6RegExp.prototype.flagsArray.prototype.includeswritableconsole
1.0.0

16 days ago