-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(transfer-of-machine-ownership): aosh ondelete (#16784)
* adding delete functionality to ownerchange machine * fix: init * chore: charts update dirty files * adding mock payment * fix: add secret from aws paramter store * removing console.log * revome other pull request * remove console.log * adding delete async func * error handling --------- Co-authored-by: Þorkell Máni Þorkelsson <[email protected]> Co-authored-by: andes-it <[email protected]> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
- Loading branch information
1 parent
6c0c221
commit e485d7e
Showing
8 changed files
with
248 additions
and
45 deletions.
There are no files selected for viewing
80 changes: 80 additions & 0 deletions
80
...es/templates/aosh/transfer-of-machine-ownership/emailGenerators/applicationDeleteEmail.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
import { Message } from '@island.is/email-service' | ||
import { EmailTemplateGeneratorProps } from '../../../../../types' | ||
import { EmailRecipient } from '../types' | ||
import { pathToAsset } from '../transfer-of-machine-ownership.utils' | ||
import { ApplicationConfigurations } from '@island.is/application/types' | ||
import { TransferOfMachineOwnershipAnswers } from '@island.is/application/templates/aosh/transfer-of-machine-ownership' | ||
|
||
export type ApplicationRejectedEmail = ( | ||
props: EmailTemplateGeneratorProps, | ||
recipient: EmailRecipient, | ||
rejectedBy: EmailRecipient | undefined, | ||
) => Message | ||
|
||
export const generateApplicationRejectedEmail: ApplicationRejectedEmail = ( | ||
props, | ||
recipient, | ||
rejectedBy, | ||
): Message => { | ||
const { | ||
application, | ||
options: { email, clientLocationOrigin }, | ||
} = props | ||
const answers = application.answers as TransferOfMachineOwnershipAnswers | ||
const regNumber = answers?.machine?.regNumber | ||
|
||
if (!recipient.email) throw new Error('Recipient email was undefined') | ||
if (!regNumber) throw new Error('Registration Number was undefined') | ||
if (!rejectedBy?.ssn) throw new Error('Rejected by ssn was undefined') | ||
|
||
const subject = 'Tilkynning um eigendaskipti - Umsókn afturkölluð' | ||
|
||
return { | ||
from: { | ||
name: email.sender, | ||
address: email.address, | ||
}, | ||
to: [{ name: recipient.name, address: recipient.email }], | ||
subject, | ||
template: { | ||
title: subject, | ||
body: [ | ||
{ | ||
component: 'Image', | ||
context: { | ||
src: pathToAsset('logo.jpg'), | ||
alt: 'Ísland.is logo', | ||
}, | ||
}, | ||
{ | ||
component: 'Image', | ||
context: { | ||
src: pathToAsset('computerIllustration.jpg'), | ||
alt: 'Kaffi við skjá myndskreyting', | ||
}, | ||
}, | ||
{ | ||
component: 'Heading', | ||
context: { copy: subject }, | ||
}, | ||
{ | ||
component: 'Copy', | ||
context: { | ||
copy: | ||
`<span>Góðan dag,</span><br/><br/>` + | ||
`<span>Beiðni um eigendaskipti á tækinu ${regNumber} hefur verið afturkölluð þar sem eigandi ökutækis eyddi umsókninni.</span><br/>` + | ||
`<span>Til þess að skrá eigendaskiptin rafrænt verður að byrja ferlið að upp á nýtt á umsóknarvef island.is: island.is/umsoknir, ásamt því að allir aðilar þurfa að staðfesta rafrænt innan gefins tímafrests.</span><br/>` + | ||
`<span>Vinsamlegast hafið samband við Vinnueftirlitið [email protected] ef nánari upplýsinga er þörf.</span>`, | ||
}, | ||
}, | ||
{ | ||
component: 'Button', | ||
context: { | ||
copy: 'Skoða umsókn', | ||
href: `${clientLocationOrigin}/${ApplicationConfigurations.TransferOfMachineOwnership.slug}/${application.id}`, | ||
}, | ||
}, | ||
], | ||
}, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.