Sends a mail to the suspended user.

This commit is contained in:
gaba
2017-03-21 15:08:46 -07:00
parent b9960c3cc7
commit 7522bd9cd6
12 changed files with 54 additions and 17 deletions
@@ -3,7 +3,7 @@ import {connect} from 'react-redux';
import {compose} from 'react-apollo';
import {modUserFlaggedQuery} from 'coral-admin/src/graphql/queries';
import {banUser, setUserStatus, suspendUser} from '../../graphql/mutations';
import {banUser, setUserStatus, suspendUser} from 'coral-admin/src/graphql/mutations';
import {
fetchAccounts,
@@ -5,7 +5,8 @@ import styles from './BanUserDialog.css';
import Button from 'coral-ui/components/Button';
import I18n from 'coral-framework/modules/i18n/i18n';
import translations from '../../../translations';
import translations from 'coral-admin/src/translations.json';
const lang = new I18n(translations);
const BanUserDialog = ({open, handleClose, handleBanUser, user}) => (
@@ -52,7 +52,7 @@ class SuspendUserDialog extends Component {
const cancel = this.props.onClose;
const next = () => this.setState({stage: stage + 1});
const suspend = () => {
suspendUser({userId: user.user.id})
suspendUser({userId: user.user.id, message: this.state.email})
.then(() => {
this.props.handleClose();
});
@@ -32,10 +32,11 @@ export const setUserStatus = graphql(SET_USER_STATUS, {
export const suspendUser = graphql(SUSPEND_USER, {
props: ({mutate}) => ({
suspendUser: ({userId}) => {
suspendUser: ({userId, message}) => {
return mutate({
variables: {
userId
userId,
message
},
refetchQueries: ['Users']
});
@@ -1,5 +1,5 @@
mutation suspendUser($userId: ID!) {
suspendUser(id: $userId) {
mutation suspendUser($userId: ID!, $message: String) {
suspendUser(id: $userId, message: $message) {
errors {
translation_key
}
+2 -2
View File
@@ -119,7 +119,7 @@
"suspenduser": {
"title": "Suspend a user",
"title_0": "We noticed you rejected a username",
"description_0": "Would you like to temporarily ban this user becuase of their {0}? Doing so will temporarily hide their comments until they rewrite their {0}.",
"description_0": "Would you like to temporarily ban this user because of their {0}? Doing so will temporarily hide their comments until they rewrite their {0}.",
"title_1": "Notify the user of their temporary suspension",
"description_1": "Suspending this user will temporarily disable their account and hide all of their comments on the site.",
"no_cancel": "No, cancel",
@@ -128,7 +128,7 @@
"bio": "bio",
"username": "username",
"email_subject": "Your account has been suspended",
"email": "Another member of the community recently flagged your username for review. Because of its content your user was rejected. This means you can no longer comment, like, or flag content until you rewrite your {0}. Please e-mail moderator@newsorg.com if you have any questions or concerns.",
"email": "Another member of the community recently flagged your username for review. Because of its content your user was rejected. This means you can no longer comment, like, or flag content until you rewrite your username. Please e-mail us if you have any questions or concerns.",
"write_message": "Write a message"
},
"dashboard": {