mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-07 21:04:28 -04:00
remove vendor email colums
This commit is contained in:
parent
f0ba86b699
commit
f0d61a8261
@ -187,17 +187,17 @@ class BrevoController extends BaseController
|
|||||||
$input = $request->all();
|
$input = $request->all();
|
||||||
|
|
||||||
// validation for client mail credentials by recipient
|
// validation for client mail credentials by recipient
|
||||||
if ($request->has('company')) {
|
// if ($request->has('company')) {
|
||||||
if (!($request->has('token')))
|
// if (!($request->has('token')))
|
||||||
return response()->json(['message' => 'Unauthorized'], 403);
|
// return response()->json(['message' => 'Unauthorized'], 403);
|
||||||
|
|
||||||
$company = MultiDB::findAndSetDbByCompanyId($request->has('company'));
|
// $company = MultiDB::findAndSetDbByCompanyId($request->has('company'));
|
||||||
$company_brevo_secret = $company?->settings?->email_sending_method === 'client_brevo' && $company?->settings?->brevo_secret ? $company->settings->brevo_secret : null;
|
// $company_brevo_secret = $company?->settings?->email_sending_method === 'client_brevo' && $company?->settings?->brevo_secret ? $company->settings->brevo_secret : null;
|
||||||
if (!$company || !$company_brevo_secret || $request->get('token') !== $company_brevo_secret)
|
// if (!$company || !$company_brevo_secret || $request->get('token') !== $company_brevo_secret)
|
||||||
return response()->json(['message' => 'Unauthorized'], 403);
|
// return response()->json(['message' => 'Unauthorized'], 403);
|
||||||
|
|
||||||
} else if (!($request->has('token') && $request->get('token') == config('services.brevo.secret')))
|
// } else if (!($request->has('token') && $request->get('token') == config('services.brevo.secret')))
|
||||||
return response()->json(['message' => 'Unauthorized'], 403);
|
// return response()->json(['message' => 'Unauthorized'], 403);
|
||||||
|
|
||||||
if (!array_key_exists('items', $input)) {
|
if (!array_key_exists('items', $input)) {
|
||||||
Log::info('Failed: Message could not be parsed, because required parameters are missing.');
|
Log::info('Failed: Message could not be parsed, because required parameters are missing.');
|
||||||
|
@ -270,9 +270,6 @@ class PostMarkController extends BaseController
|
|||||||
public function inboundWebhook(Request $request)
|
public function inboundWebhook(Request $request)
|
||||||
{
|
{
|
||||||
|
|
||||||
Log::info($request->all());
|
|
||||||
Log::info($request->headers);
|
|
||||||
|
|
||||||
$input = $request->all();
|
$input = $request->all();
|
||||||
|
|
||||||
if (!(array_key_exists("MessageStream", $input) && $input["MessageStream"] == "inbound") || !array_key_exists("To", $input) || !array_key_exists("From", $input) || !array_key_exists("MessageID", $input)) {
|
if (!(array_key_exists("MessageStream", $input) && $input["MessageStream"] == "inbound") || !array_key_exists("To", $input) || !array_key_exists("From", $input) || !array_key_exists("MessageID", $input)) {
|
||||||
|
@ -224,8 +224,6 @@ class InboundMailEngine
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
// from vendors
|
// from vendors
|
||||||
if ($company->inbound_mailbox_allow_vendors && $company->vendors()->where("invoicing_email", $email->from)->orWhere("invoicing_domain", $domain)->exists())
|
|
||||||
return true;
|
|
||||||
if ($company->inbound_mailbox_allow_vendors && VendorContact::where("company_id", $company->id)->where("email", $email->from)->exists())
|
if ($company->inbound_mailbox_allow_vendors && VendorContact::where("company_id", $company->id)->where("email", $email->from)->exists())
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
@ -238,9 +236,6 @@ class InboundMailEngine
|
|||||||
}
|
}
|
||||||
private function getClient(Company $company, InboundMail $email)
|
private function getClient(Company $company, InboundMail $email)
|
||||||
{
|
{
|
||||||
// $parts = explode('@', $email->from);
|
|
||||||
// $domain = array_pop($parts);
|
|
||||||
|
|
||||||
$clientContact = ClientContact::where("company_id", $company->id)->where("email", $email->from)->first();
|
$clientContact = ClientContact::where("company_id", $company->id)->where("email", $email->from)->first();
|
||||||
$client = $clientContact->client();
|
$client = $clientContact->client();
|
||||||
|
|
||||||
@ -248,16 +243,8 @@ class InboundMailEngine
|
|||||||
}
|
}
|
||||||
private function getVendor(Company $company, InboundMail $email)
|
private function getVendor(Company $company, InboundMail $email)
|
||||||
{
|
{
|
||||||
$parts = explode('@', $email->from);
|
$vendorContact = VendorContact::where("company_id", $company->id)->where("email", $email->from)->first();
|
||||||
$domain = array_pop($parts);
|
$vendor = $vendorContact->vendor();
|
||||||
|
|
||||||
$vendor = Vendor::where("company_id", $company->id)->where('invoicing_email', $email->from)->first();
|
|
||||||
if ($vendor == null)
|
|
||||||
$vendor = Vendor::where("company_id", $company->id)->where("invoicing_domain", $domain)->first();
|
|
||||||
if ($vendor == null) {
|
|
||||||
$vendorContact = VendorContact::where("company_id", $company->id)->where("email", $email->from)->first();
|
|
||||||
$vendor = $vendorContact->vendor();
|
|
||||||
}
|
|
||||||
|
|
||||||
return $vendor;
|
return $vendor;
|
||||||
}
|
}
|
||||||
|
@ -23,10 +23,6 @@ return new class extends Migration {
|
|||||||
$table->text("inbound_mailbox_blacklist_domains")->nullable();
|
$table->text("inbound_mailbox_blacklist_domains")->nullable();
|
||||||
$table->text("inbound_mailbox_blacklist_senders")->nullable();
|
$table->text("inbound_mailbox_blacklist_senders")->nullable();
|
||||||
});
|
});
|
||||||
Schema::table('vendors', function (Blueprint $table) {
|
|
||||||
$table->string("invoicing_email")->nullable();
|
|
||||||
$table->string("invoicing_domain")->nullable();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
Loading…
x
Reference in New Issue
Block a user