Running SMTP Conditionally

I’m working on developing a support website and I’m using Gravity Forms to handle the support ticket form. I have the form notification configured so that the "From" shows my client’s email address instead of the email address from the SMTP.

I need it to do this because I have another plugin that pipes emails sent to a specific inbox. That plugin handles the actual help desk. I’m explaining this part to give some background into what I’m trying to accomplish.

Any SMTP plugin that I use will force all emails coming from the website to use the "From" email set up within the plugin. Gravity Forms won’t override the "From" email notification. I want SMTP to work all the time EXCEPCT for when an email is getting sent out with a different "From".

I found some code to execute from my functions.php file that will change the default wp_mail() if the "From" email doesn’t match. Exactly what I want..:

add_filter('wp_mail_from', 'doEmailFilter'); add_filter('wp_mail_from_name', 'doEmailNameFilter');  function doEmailFilter($  email_address){ if($  email_address === "")     return ''; else     return $  email_address; } function doEmailNameFilter($  email_from){ if($  email_from === "WordPress")     return 'Site Admin'; else     return $  email_from; } 

I also found code that will run SMTP from functions.php:

add_action( 'phpmailer_init', 'send_smtp_email' ); function send_smtp_email( $  phpmailer ) {     $  phpmailer->isSMTP();     $  phpmailer->Host       = SMTP_HOST;     $  phpmailer->SMTPAuth   = SMTP_AUTH;     $  phpmailer->Port       = SMTP_PORT;     $  phpmailer->Username   = SMTP_USER;     $  phpmailer->Password   = SMTP_PASS;     $  phpmailer->SMTPSecure = SMTP_SECURE;     $  phpmailer->From       = SMTP_FROM;     $  phpmailer->FromName   = SMTP_NAME; } 

How would I go about combining these two pieces of code so that the SMTP would run and process the the desired "From" email ONLY if the "From" email doesn’t match? Is such a thing possible? Thank you!

How to Fix Undefined array key “action” on WordPress site running on Php8

I’m getting error PHP message: PHP Warning: Undefined array key "action" for this code:

function disable_lost_password() {     if ( in_array( $  _GET['action'], array('lostpassword', 'retrievepassword') ) ) {         wp_redirect( wp_login_url(), 301 );         exit;     } } add_action( "init", "disable_lost_password" ); 

How to fix it?

Can you show rng code running in real time in a game?

First off, I know almost nothing about game development/rng but I will learn. So apologies for sounding uninformed.

I want to make a sandbox ios game with several activities to do within, one of which is poker, but I want the poker to be infallibly transparent unlike online poker. They wouldn’t dare.

So I want to show the rng code to be viewable by players as the hand plays out, so players will know its legit, and can verify after the hand etc if they have concerns, is this possible, can you "show" rng?

Error while Running query in postgreSQL from sql server 2016

The below query runs well in sql server 2016:

 select ResellerId, vCompanyName ,x.*  from wlt_tblReseller AS main  outer apply ( select (count (ipkReportTypeId)) AS "count", vReportTypeName                 from wlt_tblReseller _all                inner join wlt_tblClient clients  on clients.ifkParentResellerId = _all.ResellerId               inner join wlt_tblReport_CompanyMaster reporslogs on reporslogs.ifkCompanyId = clients.ClientId               inner join wlt_tblReports_TypeMaster rpt_types on rpt_types.ipkReportTypeId = reporslogs.ifkReportTypeId                where RootResellerId = main.ResellerId                  and rpt_types.bStatus =1                  and bIsStatic =1                  and vReportTypeName  is not null               group by ipkReportTypeId,vReportTypeName             ) AS x  WHERE IsMiniReseller = 0    and ResellerId <> 1     and vReportTypeName is not null  order by  vCompanyName desc  

But when I take it to postgreSQL and change outer apply to LEFT JOIN LATERAL,it does not run and produces the following error:

ERROR: syntax error at or near "WHERE" LINE 9: )AS x WHERE IsMiniReseller = 0 and ResellerId <> 1 and v… SQL state: 42601 Character: 649

What could I be missing?Any help will be much appreciated.

Regards Chris.

sqlcmd is running but database shown no running query

We are facing this weird issue on our Azure setup. The database is SQLServer and client is CentOS. We fire queries using sqlcmd. Sometimes it happens that you see the sqlcmd running, but there is no runnable/sleeping query running in db (seen using sp_who2). This happens only for DML queries, for the queries of the sort insert into < sometable > select < someslectquery >.

And this happens like 25% of time. This occurs even when we run some procedure. The procedure stops at some insert .. select query. But sqlcmd still show s it running.

We have another setup with AWS with same database and same Centos, but we haven’t seen this thing happening there.

On same azure database, when we run the queries using windows machine using SSMS then the query completed on back-end. We tested this multiple times.

Has anyone face any such thing? Where to look for the issue?

Can I use Zephyr Strike outside of combat to increase my running speed?

The spell Zephyr Strike, from XGE, has the following text:

You move like the wind. Until the spell ends, your movement doesn’t provoke opportunity attacks. Once before the spell ends, you can give yourself advantage on one weapon attack roll on your turn. That attack deals an extra 1d8 force damage on a hit. Whether you hit or miss, your walking speed increases by 30 feet until the end of that turn.

Clearly this spell was written with combat in mind. I’m curious what support, if any, exists for using it outside of combat for the purpose of increasing a character’s movement speed, for instance in a foot chase.

What I would like to happen: I cast Zephyr Strike, waive the attack, and immediately trigger the bonus 30 feet of speed (say, to 60 ft). Since Zephyr Strike’s casting time is a bonus action, I then take the dash action, doubling my speed to 120 feet. I have this speed for 6 seconds.

My interpretation of the spell as written: The bonus to speed requires the player to take the attack action. The extra speed only lasts until the end of the turn. So to gain the speed benefit, a player must attack something, which uses their action and prevents the use of the dash action while under the effect of the spell.

Obviously the DM can rule however they want, but I’m curious what support the rules might have for my preferred outcome.

Running select filename from dbo.sysfiles returns short foldernames with tilde

I am running the following statement in SQL Server 2014(in Windows 2012R2):

select filename from dbo.sysfiles where fileid = 1 

However it returns:


I wish for the full path without the tilde.

(e.g C:\Program Files\Microsoft SQL Server\MSSQL12.SQL2014\MSSQL\DATA\master.mdf)

I tried upgrading the SQL Server 2014 Express to 2016 Express but it made no difference.

Any ideas? Thanks. Dave

UE4 – Timeline isn’t running

I suspected in my last question, that the problem was caused probably by the timeline I used in the custom event I made, Move To.

What I did was I researched this problem, viewed the documentation, and took a good look at the timeline itself, but I couldn’t find anything that could solve this problem.

The code is pasted here in BlueprintUE, in the MoveTo custom event if you need to see the code. Here is a picture of the timeline:


I have been trying to fix this problem for days, help would be very much appreciated! Thank you!

How is movement calculated when running up walls as a monk?

Picture this circumstance. I am a 5 foot tall level 9 Wood Elf Monk with Mobile. I have 60 feet of speed per turn, via:

  • 35 feet from Wood Elf feature
  • 10 feet from the Mobile feat
  • 15 feet from being a level 9 monk

And can run on walls via the monk’s Unarmored Movement class feature.

I am 15 feet away from a medium sized melee combatant in a 5 foot wide corridor with a 20 foot high ceiling.

Avoiding all attacks of opportunity against me and without using any attacks from me and only the wall movement + speed listed, what is my maximum possible remaining movement to be on the other side of the combatant, out of range, with this setup?

To simplify this, I want to run up the wall, around the guy, without giving him a chance to hit me with his 5 foot range, and still have as much movement possible.

You know, normal Monk things.

My main concern is how the movement starts, and how diagonals work while wall running. Do I spend 5 feet to start “wall running” in the same square I’m in, or do I start by spending 5 feet to be 10 feet in the air? Can I simultaneously move forward while moving up?

I’ve also considered the potential of dropping while on the wall to conserve movement (presumably 10 feet past the combatant), and I want to suggest that for anyone to consider it themselves as a potential part of the answer.

Considering how abstract this question is, there may not be an official answer in 5e, but references to prior editions/Pathfinder on this topic would be valid substitutes.