Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] How to use assets or static files when using <Img> #30

Open
socketopp opened this issue Dec 26, 2023 · 2 comments
Open

[Question] How to use assets or static files when using <Img> #30

socketopp opened this issue Dec 26, 2023 · 2 comments

Comments

@socketopp
Copy link

Currently I use an url that is pointing to my image. But I can't figure out how to include a static image. Would really appreciate if anyone could provide an example how to embed static images to the email template.

@cmjoseph07
Copy link

cmjoseph07 commented Mar 7, 2024

@socketopp

You can import the import the image than use it directly in src. An example would be below:

import ghost from '/ghost.png' // This will be the path to your static image

<Img src={ghost} />

@socketopp
Copy link
Author

@socketopp

You can import the import the image than use it directly in src. An example would be below:

import ghost from '/ghost.png' // This will be the path to your static image

<Img src={ghost} />

I tried that but it didn't work

import email_logo from './logo_mail.png';
...
<Container style={headerContainer}>
  <Link href={baseUrl} style={{ height: 'fit', textAlign: 'center' }}>
    <Img src={email_logo} alt="logo" style={image} width="160px" height="22px" />
  </Link>
</Container>

In gmail, it points to some 404 google endpoint
https://ci3.googleusercontent.com/meips/[:id]..-ft#http:///src/lib/emails/templates/logo_mail.png?t=151515158158

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants