-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat send email students course #1
Conversation
I'm getting this error after running
Am I missing a step? Update: it worked after running |
src/components/bulk-email-tool/bulk-email-form/BulkEmailForm.jsx
Outdated
Show resolved
Hide resolved
if (action === FORM_ACTIONS.POST) { | ||
const emailData = new FormData(); | ||
emailData.append('action', 'send'); | ||
emailData.append('send_to', JSON.stringify(editor.emailRecipients)); | ||
emailData.append('subject', editor.emailSubject); | ||
emailData.append('message', editor.emailBody); | ||
emailData.append('email_learners', JSON.stringify(emailsFormat)); |
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 we use: individual-student-emails
?
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.
or if learners are used across the app: individual-learners-emails
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 can use it with underscore individual_learners_emails
src/components/bulk-email-tool/bulk-email-form/BulkEmailForm.jsx
Outdated
Show resolved
Hide resolved
src/components/bulk-email-tool/bulk-email-form/BulkEmailForm.jsx
Outdated
Show resolved
Hide resolved
src/components/bulk-email-tool/bulk-email-form/BulkEmailForm.jsx
Outdated
Show resolved
Hide resolved
src/components/bulk-email-tool/bulk-email-form/BulkEmailForm.jsx
Outdated
Show resolved
Hide resolved
src/components/bulk-email-tool/bulk-email-form/BulkEmailForm.jsx
Outdated
Show resolved
Hide resolved
src/components/bulk-email-tool/bulk-email-form/BulkEmailForm.jsx
Outdated
Show resolved
Hide resolved
...mponents/bulk-email-tool/bulk-email-form/bulk-email-recipient/components/EmailList/index.jsx
Outdated
Show resolved
Hide resolved
...mponents/bulk-email-tool/bulk-email-form/bulk-email-recipient/components/EmailList/index.jsx
Outdated
Show resolved
Hide resolved
const errorMessage = screen.getByText('Invalid email address'); | ||
expect(errorMessage).toBeInTheDocument(); | ||
}); | ||
}); |
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.
What about these test cases:
- Removing an email chip works
- Sending an email with empty recipients fails
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.
"Sending an email with empty recipients fails" it's out this component
@@ -0,0 +1,5 @@ | |||
/* eslint-disable import/prefer-default-export */ | |||
export const isValidEmail = (email) => { | |||
const emailRegex = /^(([^<>()·=~ºªÇ¨?¿*^|#¢∞¬÷"$%"≠´}{![\]\\.,;:\s@"]+(\.[^<>·$%&/=~ºªÇ¨?¿*^|#¢∞¬÷""≠´}{!()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; |
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.
Is this the same validation that the https://github.com/openedx/frontend-app-authn runs when registering a user (without custom registration rules)?
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.
They have a regex for that as well here
but is not the same, that one doesn't allow uppercase
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 we use that one? So we know it's maintained elsewhere. We can add a comment where we got it from
eead98a
to
3b14c1f
Compare
57c04b1
to
0f667ad
Compare
@johnvente |
56059c2
to
86b1575
Compare
86b1575
to
a68368b
Compare
Welcome to Codecov 🎉Once merged to your default branch, Codecov will compare your coverage reports and display the results in this comment. Thanks for integrating Codecov - We've got you covered ☂️ |
This PR won't be more maintained so I'm closing it |
This feature will allow sending emails to expected emails of students in the course
DEMO
Currently without typehead
With typehead
How to test it
If you are using devstack
http://localhost:1984/courses/{{id_course}}/bulk_email
If you are getting problems check this:
For this
in :
src/components/page-container/data/api.js
Which is like this:
in
src/components/bulk-email-tool/BulkEmailTool.jsx
Change it to this: