cambiatus / backend

Cambiatus GraphQL API
GNU Affero General Public License v3.0
21 stars 18 forks source link

Render markdown on transfer email #184

Closed lucca65 closed 3 years ago

lucca65 commented 3 years ago

After https://github.com/cambiatus/frontend/issues/615, we now allow for rich text on transfers memo. Rendering might be off when sending emails, so we must make sure we are properly rendering it. We use pure markdown, so it might be easy with libs like https://github.com/pragdave/earmark

ryguigas0 commented 3 years ago

Hey could you assign me this and add the hacktoberfest tag?

lucca65 commented 3 years ago

Doen @ryguigas0 good luck!

ryguigas0 commented 3 years ago

Hey is there an list of routes I can use for sending transfer emails? Since I couldnt find any tests to use

lucca65 commented 3 years ago

hey @ryguigas0 there is no need for you to worry about routes. In this app in particular no routes trigger emails.

Instead you can run this command on the project:

$ iex -S mix phx.server

This will start an interactive console for the project, where you can call email sending directly!

iex(1)> Repo.all(Cambiatus.Commune.Transfer) |> hd |> CambiatusWeb.Email.transfer

Open your browser on http://localhost:4000/dev/mailbox. You should have enough to keep going

ryguigas0 commented 3 years ago

That's all I needed to know thanks!

ryguigas0 commented 3 years ago

Hello again! I've been trying anything I could to create an Transfer since Repo.all returned an empty list and seeds.exs doesnt have an Transfer created. Could explain me what are the Transfer struct and how its created and sent?

lucca65 commented 3 years ago

hey @ryguigas0, maybe some knowledge with elixir would be useful! Here are some resources:

I can grab a snippet but I think its worth the challenge for you! let me know if you need me to provide you the answer

ryguigas0 commented 3 years ago

Thanks for the learning resources! I have figured out how to create a transfer and turn a markdown memo into html memo. Now I'm going to clear a rendering problem and send the PR. Thanks a lot for the help!

lucca65 commented 3 years ago

@ryguigas0 That's great! congrats on the progress so far! If you want you can open a draft PR, this way I can better assist you!

ryguigas0 commented 3 years ago

If it's ok to say, my PR to count on Hacktofest the project topic should be 'hacktoberfest' not 'hacktoberfest2021'. It would be nice if you could change it. Also can I post this project on the hacktoberfest discord? (I'll send a link or a print)

lucca65 commented 3 years ago

done! Yeah, please do! 💪

ryguigas0 commented 3 years ago

Oops by project I meant the repo, also heres the link you should also post something there, it might bring more contributors here