Add powered by Probo in email footer
Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
BIN
apps/console/public/logos/probo-gray-small.png
Normal file
BIN
apps/console/public/logos/probo-gray-small.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.8 KiB |
@@ -19,6 +19,7 @@ import (
|
|||||||
"embed"
|
"embed"
|
||||||
"fmt"
|
"fmt"
|
||||||
htmltemplate "html/template"
|
htmltemplate "html/template"
|
||||||
|
"net/url"
|
||||||
texttemplate "text/template"
|
texttemplate "text/template"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@@ -39,6 +40,7 @@ type (
|
|||||||
|
|
||||||
PresenterVariables struct {
|
PresenterVariables struct {
|
||||||
// Static variables
|
// Static variables
|
||||||
|
BaseOrigin string
|
||||||
BaseURL string
|
BaseURL string
|
||||||
SenderCompanyName string
|
SenderCompanyName string
|
||||||
SenderCompanyWebsiteURL string
|
SenderCompanyWebsiteURL string
|
||||||
@@ -67,8 +69,15 @@ func DefaultPresenterConfig(baseURL string) PresenterConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func NewPresenterFromConfig(cfg PresenterConfig, fullName string) *Presenter {
|
func NewPresenterFromConfig(cfg PresenterConfig, fullName string) *Presenter {
|
||||||
|
baseURL := baseurl.MustParse(cfg.BaseURL)
|
||||||
|
baseOrigin := url.URL{
|
||||||
|
Scheme: baseURL.Scheme(),
|
||||||
|
Host: baseURL.Host(),
|
||||||
|
}
|
||||||
|
|
||||||
return &Presenter{
|
return &Presenter{
|
||||||
variables: PresenterVariables{
|
variables: PresenterVariables{
|
||||||
|
BaseOrigin: baseOrigin.String(),
|
||||||
BaseURL: cfg.BaseURL,
|
BaseURL: cfg.BaseURL,
|
||||||
SenderCompanyName: cfg.SenderCompanyName,
|
SenderCompanyName: cfg.SenderCompanyName,
|
||||||
SenderCompanyWebsiteURL: cfg.SenderCompanyWebsiteURL,
|
SenderCompanyWebsiteURL: cfg.SenderCompanyWebsiteURL,
|
||||||
|
|||||||
@@ -1,17 +1,15 @@
|
|||||||
import {
|
import {
|
||||||
Body,
|
Body,
|
||||||
Button,
|
|
||||||
Container,
|
Container,
|
||||||
Head,
|
Head,
|
||||||
Heading,
|
|
||||||
Html,
|
Html,
|
||||||
Link,
|
Link,
|
||||||
Preview,
|
|
||||||
Section,
|
Section,
|
||||||
Text,
|
Text,
|
||||||
} from '@react-email/components';
|
} from '@react-email/components';
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { Logo } from './Logo';
|
import { Logo } from './Logo';
|
||||||
|
import { ProboLogo } from './ProboLogo';
|
||||||
|
|
||||||
interface EmailLayoutProps {
|
interface EmailLayoutProps {
|
||||||
subject: string;
|
subject: string;
|
||||||
@@ -47,6 +45,12 @@ export const EmailLayout = ({
|
|||||||
<Text style={footerAddress}>
|
<Text style={footerAddress}>
|
||||||
{"{{.SenderCompanyHeadquarterAddress}}"}
|
{"{{.SenderCompanyHeadquarterAddress}}"}
|
||||||
</Text>
|
</Text>
|
||||||
|
<Text style={footerAddress}>
|
||||||
|
<span style={{verticalAlign: "middle"}}>Powered By </span>
|
||||||
|
<Link style={{display: "inline-block", height: "16px", verticalAlign: "middle"}} href="https://www.getprobo.com">
|
||||||
|
<ProboLogo />
|
||||||
|
</Link>
|
||||||
|
</Text>
|
||||||
</Section>
|
</Section>
|
||||||
</Container>
|
</Container>
|
||||||
</Body>
|
</Body>
|
||||||
|
|||||||
13
packages/emails/src/components/ProboLogo.tsx
Normal file
13
packages/emails/src/components/ProboLogo.tsx
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
import { Img } from '@react-email/components';
|
||||||
|
import * as React from 'react';
|
||||||
|
|
||||||
|
export function ProboLogo() {
|
||||||
|
return (
|
||||||
|
<Img
|
||||||
|
style={{verticalAlign: "middle", height: "100%"}}
|
||||||
|
src="{{.BaseOrigin}}/logos/probo-gray-small.png"
|
||||||
|
alt="Probo"
|
||||||
|
height="16"
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user