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

Email Forwards: Bump the number of email forwards allowed for business users. #1205

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const EmailForwardingAddNew = React.createClass( {
},

hasReachedLimit() {
return this.props.emailForwarding.list.length >= 5;
return this.props.emailForwarding.list.length >= this.props.maxForwards;
},

onAddEmailForward( event ) {
Expand Down Expand Up @@ -160,7 +160,8 @@ const EmailForwardingAddNew = React.createClass( {
return (
<form className="email-forwarding__add-new">
<EmailForwardingLimit
emailForwarding={ this.props.emailForwarding } />
emailForwarding={ this.props.emailForwarding }
maxForwards={ this.props.maxForwards } />

{ this.formFields() }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@
import React from 'react';

const EmailForwardingLimit = React.createClass( {
maxForwards() {
if ( this.props.maxForwards === 500 ) {
return this.translate( 'unlimited' );
}

return this.props.maxForwards;
},

render() {
const used = this.props.emailForwarding.list.length;

Expand All @@ -16,7 +24,7 @@ const EmailForwardingLimit = React.createClass( {
'You are using %(used)s out of %(available)s email forwards.', {
args: {
used,
available: 5
available: this.maxForwards()
}
} ) }</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import EmailForwardingDetails from './email-forwarding-details';
import paths from 'my-sites/upgrades/paths';
import Card from 'components/card/compact';
import SectionHeader from 'components/section-header';
import { isBusiness } from 'lib/products-values';

const EmailForwarding = React.createClass( {
propTypes: {
Expand All @@ -27,6 +28,14 @@ const EmailForwarding = React.createClass( {
] ).isRequired
},

maxForwards() {
if ( isBusiness( this.props.selectedSite.plan ) ) {
return 500;
}

return 5;
},

render() {
if ( this.isDataLoading() ) {
return <MainPlaceholder goBack={ this.goToEditEmail } />;
Expand All @@ -51,7 +60,8 @@ const EmailForwarding = React.createClass( {
<EmailForwardingAddNew
emailForwarding={ this.props.emailForwarding }
selectedDomainName={ this.props.selectedDomainName }
selectedSite={ this.props.selectedSite } />
selectedSite={ this.props.selectedSite }
maxForwards={ this.maxForwards() } />
</Card>
</Main>
);
Expand Down