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
library: Add Email Entry #330
Conversation
@andyholmes Can you please provide an early review for the email demo? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
works for me
the issue might be that you don't have an email application
Please make sure to use |
Yes , i was just making sure if it was a problem on my side. Idk if it's relevant or not but shouldn't it be triggered if there's no email app on the user? For example: if user hasn't installed any email app, browser should be accessed with an email template |
This worked fine for me when i installed the app :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice to add a text input inviting the user to enter their email address and use it for the addresses
arg.
This way, when the user can test by sending the email to themselves directly.
wdyt?
src/Library/demos/Email/main.blp
Outdated
using Adw 1; | ||
|
||
Adw.StatusPage { | ||
title: "Email"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all user visible strings should be wrapper in _()
please try to remember
title: "Email"; | |
title: _("Email"); |
src/Library/demos/Email/main.blp
Outdated
label: _("Send Email"); | ||
margin-bottom: 42; | ||
halign: center; | ||
styles ["suggested-action"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
styles ["suggested-action"] | |
styles ["suggested-action", "pill"] |
for buttons outside of toolbars
src/Library/demos/Email/main.js
Outdated
["sonicworks05@gmail.com"], | ||
["test@gmail.com"], | ||
null, | ||
"Demo Message", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add a comment next to each line with the name of the argument so it's clear what is what?
For example here
"Demo Message", | |
"Demo Message", // subject |
src/Library/demos/Email/main.js
Outdated
["sonicworks05@gmail.com"], | ||
["test@gmail.com"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't use your personal data in examples.
["sonicworks05@gmail.com"], | |
["test@gmail.com"], | |
["example@example.com"], // addresses | |
null, // cc |
src/Library/demos/Email/main.js
Outdated
} | ||
} | ||
|
||
button.connect("clicked", sendEmail); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have updated our practice a bit here see #339
Please remove the try catch from sendEmail to make the function simpler and do the following instead
button.connect("clicked", sendEmail); | |
button.connect("clicked", () => { | |
onClicked().catch(logError); | |
)); |
src/Library/demos/Email/main.js
Outdated
["sonicworks05@gmail.com"], | ||
["test@gmail.com"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't use your personal data in examples.
["sonicworks05@gmail.com"], | |
["test@gmail.com"], | |
["example@example.com"], // addresses | |
null, // cc |
src/Library/demos/Email/main.js
Outdated
["test@gmail.com"], | ||
null, | ||
"Demo Message", | ||
"Demo Content", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest "Email from Workbench" as subject and "Hello World!" as body
src/Library/demos/Email/main.json
Outdated
{ | ||
"name": "Email", | ||
"category": "platform", | ||
"description": "Compose an email message", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remember to write description from the perspective of the developer
"description": "Compose an email message", | |
"description": "Trigger an email", |
src/Library/demos/Email/main.js
Outdated
|
||
async function sendEmail() { | ||
try { | ||
const result = await portal.compose_email( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const result = await portal.compose_email( | |
const success = await portal.compose_email( |
src/Library/demos/Email/main.js
Outdated
if (result) { | ||
console.log("Email app opened"); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It could be a web app or the app could already be opened. It's best not to be overly specific if we don't know for sure what will happen.
Also we know from your experience what a case for failure can be so maybe we can help the user figure it out.
if (result) { | |
console.log("Email app opened"); | |
} | |
if (success) { | |
console.log("Success"); | |
} else { | |
console.log("Failure, verify that you have a register email application."); | |
} |
src/Library/demos/Email/main.blp
Outdated
|
||
Adw.StatusPage { | ||
title: "Email"; | ||
description: _("Compose an email"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
description: _("Compose an email"); | |
description: _("Trigger an email"); |
Sure, it's a good idea |
Made the following changes
|
* Adds Adw.AboutWindow Demo * Updated Link * Updated Code * Updated Icon * Added Acknowledgement Section
* library: Add AdwAnimation entry * Animation: Fix CallbackAnimationTarget and add AnimationTarget example * Animation: Add links * Animation: Changes from review * Animation: Update main.css
* Added TextView Demo * Updated JS Code * Updated Code * Formatting Changes
* libary: Add SpinButton entry * Spin Button: Add link to tutorial * Spin Button: Changes from review * Spin Button: Translated strings * Spin Button: Add comments for clarity
* library: Add AdwBanner entry * Banner: Translate strings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well done.
I made minor changes a3966fb
Make sure to use the name of arguments as defined by the API documentation next time.
Closes #329