Skip to content

Commit

Permalink
Merge pull request #577 from research-software-directory/451-email-te…
Browse files Browse the repository at this point in the history
…mplates

fix: more information in invitation email templates
  • Loading branch information
ewan-escience authored Oct 12, 2022
2 parents 044034f + 2a8a73d commit 92a6bd4
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import InvitationList from '~/components/layout/InvitationList'
import {Invitation} from '~/types/Invitation'
import {getUnusedInvitations} from '~/utils/getUnusedInvitations'

export default function OrganisationMaintainerLink({organisation, account, token}:
{ organisation: string, account: string, token: string }) {
export default function OrganisationMaintainerLink({organisation, name, account, token}:
{organisation: string, name: string, account: string, token: string}) {
const {showErrorMessage,showInfoMessage} = useSnackbar()
const [magicLink, setMagicLink] = useState(null)
const [unusedInvitations, setUnusedInvitations] = useState<Invitation[]>([])
Expand Down Expand Up @@ -81,7 +81,7 @@ export default function OrganisationMaintainerLink({organisation, account, token
>
<a
target="_blank"
href={`mailto:?subject=Organisation maintainer invite&body=Please use the link to become organisation maintainer. \n ${magicLink}`} rel="noreferrer">
href={`mailto:?subject=Maintainer invite for organisation ${encodeURIComponent(name)}&body=Please use the following link to become a maintainer of the organisation ${encodeURIComponent(name)}. ${encodeURIComponent('\n')}${magicLink}`} rel="noreferrer">
Email this invite
</a>
</Button>
Expand Down
3 changes: 3 additions & 0 deletions frontend/components/organisation/maintainers/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// SPDX-FileCopyrightText: 2022 Dusan Mijatovic (dv4all)
// SPDX-FileCopyrightText: 2022 Ewan Cahen (Netherlands eScience Center) <e.cahen@esciencecenter.nl>
// SPDX-FileCopyrightText: 2022 Netherlands eScience Center
// SPDX-FileCopyrightText: 2022 dv4all
//
// SPDX-License-Identifier: Apache-2.0
Expand Down Expand Up @@ -113,6 +115,7 @@ export default function OrganisationMaintainers({organisation, isMaintainer}:
/>
<OrganisationMaintainerLink
organisation={organisation.id ?? ''}
name={organisation.name}
account={user?.account ?? ''}
token={token}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import InvitationList from '~/components/layout/InvitationList'
import {Invitation} from '~/types/Invitation'
import {getUnusedInvitations} from '~/utils/getUnusedInvitations'

export default function ProjectMaintainerLink({project,account,token}: { project: string,account:string,token: string }) {
export default function ProjectMaintainerLink({project,title,account,token}: {project: string, title: string, account: string, token: string}) {
const {showErrorMessage,showInfoMessage} = useSnackbar()
const [magicLink, setMagicLink] = useState(null)
const [unusedInvitations, setUnusedInvitations] = useState<Invitation[]>([])
Expand Down Expand Up @@ -80,7 +80,7 @@ export default function ProjectMaintainerLink({project,account,token}: { project
>
<a
target="_blank"
href={`mailto:?subject=Project maintainer invite&body=Please use the link to become project maintainer. \n ${magicLink}`} rel="noreferrer">
href={`mailto:?subject=Maintainer invite for project ${encodeURIComponent(title)}&body=Please use the following link to become a maintainer of the project ${encodeURIComponent(title)}. ${encodeURIComponent('\n')}${magicLink}`} rel="noreferrer">
Email this invite
</a>
</Button>
Expand Down
3 changes: 3 additions & 0 deletions frontend/components/projects/edit/maintainers/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// SPDX-FileCopyrightText: 2022 Dusan Mijatovic (dv4all)
// SPDX-FileCopyrightText: 2022 Ewan Cahen (Netherlands eScience Center) <e.cahen@esciencecenter.nl>
// SPDX-FileCopyrightText: 2022 Netherlands eScience Center
// SPDX-FileCopyrightText: 2022 dv4all
//
// SPDX-License-Identifier: Apache-2.0
Expand Down Expand Up @@ -113,6 +115,7 @@ export default function ProjectMaintainers() {
/>
<ProjectMaintainerLink
project={project.id}
title={project.title}
account={user?.account ?? ''}
token={token}
/>
Expand Down
4 changes: 3 additions & 1 deletion frontend/components/software/edit/editSoftwareContext.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// SPDX-FileCopyrightText: 2022 Dusan Mijatovic (dv4all)
// SPDX-FileCopyrightText: 2022 Ewan Cahen (Netherlands eScience Center) <e.cahen@esciencecenter.nl>
// SPDX-FileCopyrightText: 2022 Helmholtz Centre Potsdam - GFZ German Research Centre for Geosciences
// SPDX-FileCopyrightText: 2022 Matthias Rüster (GFZ) <matthias.ruester@gfz-potsdam.de>
// SPDX-FileCopyrightText: 2022 Netherlands eScience Center
// SPDX-FileCopyrightText: 2022 dv4all
//
// SPDX-License-Identifier: Apache-2.0
Expand All @@ -13,7 +15,7 @@ import {EditSoftwareAction, editSoftwareReducer} from './editSoftwareReducer'
export type SoftwareInfo = {
id: string | null,
slug: string | null,
brand_name: string | null,
brand_name: string,
concept_doi: string | null,
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {Invitation} from '~/types/Invitation'
import InvitationList from '~/components/layout/InvitationList'
import {getUnusedInvitations} from '~/utils/getUnusedInvitations'

export default function SoftwareMaintainerLink({software,account,token}: { software: string,account:string,token: string }) {
export default function SoftwareMaintainerLink({software,brand_name,account,token}: {software: string, brand_name: string, account: string,token: string}) {
const {showErrorMessage,showInfoMessage} = useSnackbar()
const [magicLink, setMagicLink] = useState(null)
const [unusedInvitations, setUnusedInvitations] = useState<Invitation[]>([])
Expand Down Expand Up @@ -82,7 +82,7 @@ export default function SoftwareMaintainerLink({software,account,token}: { softw
>
<a
target="_blank"
href={`mailto:?subject=Software maintainer invite&body=Please use the link to become software maintainer. \n ${magicLink}`} rel="noreferrer">
href={`mailto:?subject=Maintainer invite for software ${encodeURIComponent(brand_name)}&body=Please use the following link to become a maintainer of the software ${encodeURIComponent(brand_name)}. ${encodeURIComponent('\n')}${magicLink}`} rel="noreferrer">
Email this invite
</a>
</Button>
Expand Down
3 changes: 3 additions & 0 deletions frontend/components/software/edit/maintainers/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// SPDX-FileCopyrightText: 2022 Dusan Mijatovic (dv4all)
// SPDX-FileCopyrightText: 2022 Ewan Cahen (Netherlands eScience Center) <e.cahen@esciencecenter.nl>
// SPDX-FileCopyrightText: 2022 Netherlands eScience Center
// SPDX-FileCopyrightText: 2022 dv4all
//
// SPDX-License-Identifier: Apache-2.0
Expand Down Expand Up @@ -110,6 +112,7 @@ export default function SoftwareMaintainers() {
/>
<SoftwareMaintainerLink
software={software.id ?? ''}
brand_name={software.brand_name}
account={user?.account ?? ''}
token={token}
/>
Expand Down
2 changes: 1 addition & 1 deletion frontend/config/userMenuItems.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import TerminalIcon from '@mui/icons-material/Terminal'
import ListAltIcon from '@mui/icons-material/ListAlt'
import BusinessIcon from '@mui/icons-material/Business'
import ManageAccountsIcon from '@mui/icons-material/ManageAccounts'
import PlaylistAddCheckIcon from '@mui/icons-material/PlaylistAddCheck';
import PlaylistAddCheckIcon from '@mui/icons-material/PlaylistAddCheck'
import Logout from '@mui/icons-material/Logout'

import {MenuItemType} from './menuItems'
Expand Down

0 comments on commit 92a6bd4

Please sign in to comment.